@develit-services/notification 0.0.23 → 0.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types.cjs +1 -1
- package/dist/@types.d.cts +5 -4
- package/dist/@types.d.mts +5 -4
- package/dist/@types.d.ts +5 -4
- package/dist/@types.mjs +1 -1
- package/dist/export/worker.cjs +12 -5
- package/dist/export/worker.d.cts +1 -1
- package/dist/export/worker.d.mts +1 -1
- package/dist/export/worker.d.ts +1 -1
- package/dist/export/worker.mjs +12 -5
- package/dist/shared/{notification.Cqu8_iNk.cjs → notification.8VrnX6x5.cjs} +8 -5
- package/dist/shared/{notification.CDgVHdh3.d.mts → notification.CI6gLJsN.d.mts} +6 -4
- package/dist/shared/{notification.DCazEi4Y.mjs → notification.DaWIyo2j.mjs} +8 -5
- package/dist/shared/{notification.-hsQiolw.d.ts → notification.Dme_B9k_.d.ts} +6 -4
- package/dist/shared/{notification.CNZwNhWN.d.cts → notification.YN3G-lx3.d.cts} +6 -4
- package/package.json +1 -1
package/dist/@types.cjs
CHANGED
package/dist/@types.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as IEmailConnector, g as
|
|
2
|
-
export { n as IPushNotification, o as ISlack, N as NotificationQueueMessage, S as SendEmailInput, b as SendEmailOutput, e as SendSlackInput, f as SendSlackOutput, c as SendSmsInput, d as SendSmsOutput, j as iContactSchema, k as iEmailSchema, s as sendEmailInputSchema, l as sendSlackInputSchema, m as sendSmsInputSchema } from './shared/notification.
|
|
1
|
+
import { I as IEmailConnector, g as IEmail, h as IContact, a as ISmsConnector, i as ISms, t as tables } from './shared/notification.YN3G-lx3.cjs';
|
|
2
|
+
export { n as IPushNotification, o as ISlack, N as NotificationQueueMessage, S as SendEmailInput, b as SendEmailOutput, e as SendSlackInput, f as SendSlackOutput, c as SendSmsInput, d as SendSmsOutput, j as iContactSchema, k as iEmailSchema, s as sendEmailInputSchema, l as sendSlackInputSchema, m as sendSmsInputSchema } from './shared/notification.YN3G-lx3.cjs';
|
|
3
3
|
import { InternalError } from '@develit-io/backend-sdk';
|
|
4
4
|
import twilio from 'twilio';
|
|
5
5
|
import { InferSelectModel, InferInsertModel } from 'drizzle-orm';
|
|
@@ -11,10 +11,11 @@ import 'drizzle-orm/sqlite-core';
|
|
|
11
11
|
|
|
12
12
|
declare class EcomailConnector extends IEmailConnector {
|
|
13
13
|
static providerName: string;
|
|
14
|
-
constructor({ API_KEY, SMTP_HOST,
|
|
14
|
+
constructor({ API_KEY, SMTP_HOST, SENDER_EMAIL, SENDER_NAME, }: {
|
|
15
15
|
API_KEY: string;
|
|
16
16
|
SMTP_HOST: string;
|
|
17
|
-
|
|
17
|
+
SENDER_EMAIL: string;
|
|
18
|
+
SENDER_NAME: string;
|
|
18
19
|
});
|
|
19
20
|
sendEmail(email: IEmail): Promise<void>;
|
|
20
21
|
protected convertEmail(email: IEmail): EMEmail;
|
package/dist/@types.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as IEmailConnector, g as
|
|
2
|
-
export { n as IPushNotification, o as ISlack, N as NotificationQueueMessage, S as SendEmailInput, b as SendEmailOutput, e as SendSlackInput, f as SendSlackOutput, c as SendSmsInput, d as SendSmsOutput, j as iContactSchema, k as iEmailSchema, s as sendEmailInputSchema, l as sendSlackInputSchema, m as sendSmsInputSchema } from './shared/notification.
|
|
1
|
+
import { I as IEmailConnector, g as IEmail, h as IContact, a as ISmsConnector, i as ISms, t as tables } from './shared/notification.CI6gLJsN.mjs';
|
|
2
|
+
export { n as IPushNotification, o as ISlack, N as NotificationQueueMessage, S as SendEmailInput, b as SendEmailOutput, e as SendSlackInput, f as SendSlackOutput, c as SendSmsInput, d as SendSmsOutput, j as iContactSchema, k as iEmailSchema, s as sendEmailInputSchema, l as sendSlackInputSchema, m as sendSmsInputSchema } from './shared/notification.CI6gLJsN.mjs';
|
|
3
3
|
import { InternalError } from '@develit-io/backend-sdk';
|
|
4
4
|
import twilio from 'twilio';
|
|
5
5
|
import { InferSelectModel, InferInsertModel } from 'drizzle-orm';
|
|
@@ -11,10 +11,11 @@ import 'drizzle-orm/sqlite-core';
|
|
|
11
11
|
|
|
12
12
|
declare class EcomailConnector extends IEmailConnector {
|
|
13
13
|
static providerName: string;
|
|
14
|
-
constructor({ API_KEY, SMTP_HOST,
|
|
14
|
+
constructor({ API_KEY, SMTP_HOST, SENDER_EMAIL, SENDER_NAME, }: {
|
|
15
15
|
API_KEY: string;
|
|
16
16
|
SMTP_HOST: string;
|
|
17
|
-
|
|
17
|
+
SENDER_EMAIL: string;
|
|
18
|
+
SENDER_NAME: string;
|
|
18
19
|
});
|
|
19
20
|
sendEmail(email: IEmail): Promise<void>;
|
|
20
21
|
protected convertEmail(email: IEmail): EMEmail;
|
package/dist/@types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as IEmailConnector, g as
|
|
2
|
-
export { n as IPushNotification, o as ISlack, N as NotificationQueueMessage, S as SendEmailInput, b as SendEmailOutput, e as SendSlackInput, f as SendSlackOutput, c as SendSmsInput, d as SendSmsOutput, j as iContactSchema, k as iEmailSchema, s as sendEmailInputSchema, l as sendSlackInputSchema, m as sendSmsInputSchema } from './shared/notification
|
|
1
|
+
import { I as IEmailConnector, g as IEmail, h as IContact, a as ISmsConnector, i as ISms, t as tables } from './shared/notification.Dme_B9k_.js';
|
|
2
|
+
export { n as IPushNotification, o as ISlack, N as NotificationQueueMessage, S as SendEmailInput, b as SendEmailOutput, e as SendSlackInput, f as SendSlackOutput, c as SendSmsInput, d as SendSmsOutput, j as iContactSchema, k as iEmailSchema, s as sendEmailInputSchema, l as sendSlackInputSchema, m as sendSmsInputSchema } from './shared/notification.Dme_B9k_.js';
|
|
3
3
|
import { InternalError } from '@develit-io/backend-sdk';
|
|
4
4
|
import twilio from 'twilio';
|
|
5
5
|
import { InferSelectModel, InferInsertModel } from 'drizzle-orm';
|
|
@@ -11,10 +11,11 @@ import 'drizzle-orm/sqlite-core';
|
|
|
11
11
|
|
|
12
12
|
declare class EcomailConnector extends IEmailConnector {
|
|
13
13
|
static providerName: string;
|
|
14
|
-
constructor({ API_KEY, SMTP_HOST,
|
|
14
|
+
constructor({ API_KEY, SMTP_HOST, SENDER_EMAIL, SENDER_NAME, }: {
|
|
15
15
|
API_KEY: string;
|
|
16
16
|
SMTP_HOST: string;
|
|
17
|
-
|
|
17
|
+
SENDER_EMAIL: string;
|
|
18
|
+
SENDER_NAME: string;
|
|
18
19
|
});
|
|
19
20
|
sendEmail(email: IEmail): Promise<void>;
|
|
20
21
|
protected convertEmail(email: IEmail): EMEmail;
|
package/dist/@types.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { E as EcomailConnector, I as IEmailConnector, d as ISmsConnector, T as TwilioConnector, i as iContactSchema, c as iEmailSchema, s as sendEmailInputSchema, b as sendSlackInputSchema, a as sendSmsInputSchema } from './shared/notification.
|
|
1
|
+
export { E as EcomailConnector, I as IEmailConnector, d as ISmsConnector, T as TwilioConnector, i as iContactSchema, c as iEmailSchema, s as sendEmailInputSchema, b as sendSlackInputSchema, a as sendSmsInputSchema } from './shared/notification.DaWIyo2j.mjs';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import '@develit-io/backend-sdk';
|
|
4
4
|
import 'zod/v4';
|
package/dist/export/worker.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
6
|
-
const twilio_connector = require('../shared/notification.
|
|
6
|
+
const twilio_connector = require('../shared/notification.8VrnX6x5.cjs');
|
|
7
7
|
const database_schema = require('../shared/notification.4b3eUEIG.cjs');
|
|
8
8
|
require('drizzle-orm');
|
|
9
9
|
require('drizzle-orm/sqlite-core');
|
|
@@ -15,7 +15,7 @@ require('twilio');
|
|
|
15
15
|
|
|
16
16
|
const tables = database_schema.schema;
|
|
17
17
|
|
|
18
|
-
const initiateEmailConnector = async (provider, apiKey, smtpHost,
|
|
18
|
+
const initiateEmailConnector = async (provider, apiKey, smtpHost, senderEmail, senderName) => {
|
|
19
19
|
const connector = [twilio_connector.EcomailConnector].find(
|
|
20
20
|
(conn) => conn.providerName === provider
|
|
21
21
|
);
|
|
@@ -24,7 +24,12 @@ const initiateEmailConnector = async (provider, apiKey, smtpHost, sender) => {
|
|
|
24
24
|
message: "Unsupported email provider",
|
|
25
25
|
status: 404
|
|
26
26
|
});
|
|
27
|
-
return new connector({
|
|
27
|
+
return new connector({
|
|
28
|
+
API_KEY: apiKey,
|
|
29
|
+
SMTP_HOST: smtpHost,
|
|
30
|
+
SENDER_EMAIL: senderEmail,
|
|
31
|
+
SENDER_NAME: senderName
|
|
32
|
+
});
|
|
28
33
|
};
|
|
29
34
|
|
|
30
35
|
const createAuditLogCommand = async ({
|
|
@@ -121,7 +126,8 @@ class NotificationServiceBase extends backendSdk.develitWorker(
|
|
|
121
126
|
this.env.EMAIL_PROVIDER,
|
|
122
127
|
this.env.EMAIL_API_KEY,
|
|
123
128
|
this.env.EMAIL_SMTP_HOST,
|
|
124
|
-
this.env.
|
|
129
|
+
this.env.EMAIL_SENDER_EMAIL,
|
|
130
|
+
this.env.EMAIL_SENDER_NAME
|
|
125
131
|
)
|
|
126
132
|
);
|
|
127
133
|
if (error2) {
|
|
@@ -201,7 +207,8 @@ class NotificationServiceBase extends backendSdk.develitWorker(
|
|
|
201
207
|
this.env.EMAIL_PROVIDER,
|
|
202
208
|
this.env.EMAIL_API_KEY,
|
|
203
209
|
this.env.EMAIL_SMTP_HOST,
|
|
204
|
-
this.env.
|
|
210
|
+
this.env.EMAIL_SENDER_EMAIL,
|
|
211
|
+
this.env.EMAIL_SENDER_NAME
|
|
205
212
|
);
|
|
206
213
|
}
|
|
207
214
|
await this.emailConnector.sendEmail(email);
|
package/dist/export/worker.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
2
2
|
import { IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
|
-
import { I as IEmailConnector, a as ISmsConnector, t as tables, N as NotificationQueueMessage, S as SendEmailInput, b as SendEmailOutput, c as SendSmsInput, d as SendSmsOutput, e as SendSlackInput, f as SendSlackOutput } from '../shared/notification.
|
|
3
|
+
import { I as IEmailConnector, a as ISmsConnector, t as tables, N as NotificationQueueMessage, S as SendEmailInput, b as SendEmailOutput, c as SendSmsInput, d as SendSmsOutput, e as SendSlackInput, f as SendSlackOutput } from '../shared/notification.YN3G-lx3.cjs';
|
|
4
4
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
5
5
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
6
6
|
import 'zod';
|
package/dist/export/worker.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
2
2
|
import { IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
|
-
import { I as IEmailConnector, a as ISmsConnector, t as tables, N as NotificationQueueMessage, S as SendEmailInput, b as SendEmailOutput, c as SendSmsInput, d as SendSmsOutput, e as SendSlackInput, f as SendSlackOutput } from '../shared/notification.
|
|
3
|
+
import { I as IEmailConnector, a as ISmsConnector, t as tables, N as NotificationQueueMessage, S as SendEmailInput, b as SendEmailOutput, c as SendSmsInput, d as SendSmsOutput, e as SendSlackInput, f as SendSlackOutput } from '../shared/notification.CI6gLJsN.mjs';
|
|
4
4
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
5
5
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
6
6
|
import 'zod';
|
package/dist/export/worker.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
2
2
|
import { IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
|
-
import { I as IEmailConnector, a as ISmsConnector, t as tables, N as NotificationQueueMessage, S as SendEmailInput, b as SendEmailOutput, c as SendSmsInput, d as SendSmsOutput, e as SendSlackInput, f as SendSlackOutput } from '../shared/notification
|
|
3
|
+
import { I as IEmailConnector, a as ISmsConnector, t as tables, N as NotificationQueueMessage, S as SendEmailInput, b as SendEmailOutput, c as SendSmsInput, d as SendSmsOutput, e as SendSlackInput, f as SendSlackOutput } from '../shared/notification.Dme_B9k_.js';
|
|
4
4
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
5
5
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
6
6
|
import 'zod';
|
package/dist/export/worker.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createInternalError, uuidv4, develitWorker, useResult, cloudflareQueue, action } from '@develit-io/backend-sdk';
|
|
2
|
-
import { E as EcomailConnector, T as TwilioConnector, s as sendEmailInputSchema, a as sendSmsInputSchema, b as sendSlackInputSchema } from '../shared/notification.
|
|
2
|
+
import { E as EcomailConnector, T as TwilioConnector, s as sendEmailInputSchema, a as sendSmsInputSchema, b as sendSlackInputSchema } from '../shared/notification.DaWIyo2j.mjs';
|
|
3
3
|
import { s as schema } from '../shared/notification.C0X8Orrh.mjs';
|
|
4
4
|
import 'drizzle-orm';
|
|
5
5
|
import 'drizzle-orm/sqlite-core';
|
|
@@ -11,7 +11,7 @@ import 'twilio';
|
|
|
11
11
|
|
|
12
12
|
const tables = schema;
|
|
13
13
|
|
|
14
|
-
const initiateEmailConnector = async (provider, apiKey, smtpHost,
|
|
14
|
+
const initiateEmailConnector = async (provider, apiKey, smtpHost, senderEmail, senderName) => {
|
|
15
15
|
const connector = [EcomailConnector].find(
|
|
16
16
|
(conn) => conn.providerName === provider
|
|
17
17
|
);
|
|
@@ -20,7 +20,12 @@ const initiateEmailConnector = async (provider, apiKey, smtpHost, sender) => {
|
|
|
20
20
|
message: "Unsupported email provider",
|
|
21
21
|
status: 404
|
|
22
22
|
});
|
|
23
|
-
return new connector({
|
|
23
|
+
return new connector({
|
|
24
|
+
API_KEY: apiKey,
|
|
25
|
+
SMTP_HOST: smtpHost,
|
|
26
|
+
SENDER_EMAIL: senderEmail,
|
|
27
|
+
SENDER_NAME: senderName
|
|
28
|
+
});
|
|
24
29
|
};
|
|
25
30
|
|
|
26
31
|
const createAuditLogCommand = async ({
|
|
@@ -117,7 +122,8 @@ class NotificationServiceBase extends develitWorker(
|
|
|
117
122
|
this.env.EMAIL_PROVIDER,
|
|
118
123
|
this.env.EMAIL_API_KEY,
|
|
119
124
|
this.env.EMAIL_SMTP_HOST,
|
|
120
|
-
this.env.
|
|
125
|
+
this.env.EMAIL_SENDER_EMAIL,
|
|
126
|
+
this.env.EMAIL_SENDER_NAME
|
|
121
127
|
)
|
|
122
128
|
);
|
|
123
129
|
if (error2) {
|
|
@@ -197,7 +203,8 @@ class NotificationServiceBase extends develitWorker(
|
|
|
197
203
|
this.env.EMAIL_PROVIDER,
|
|
198
204
|
this.env.EMAIL_API_KEY,
|
|
199
205
|
this.env.EMAIL_SMTP_HOST,
|
|
200
|
-
this.env.
|
|
206
|
+
this.env.EMAIL_SENDER_EMAIL,
|
|
207
|
+
this.env.EMAIL_SENDER_NAME
|
|
201
208
|
);
|
|
202
209
|
}
|
|
203
210
|
await this.emailConnector.sendEmail(email);
|
|
@@ -34,11 +34,13 @@ class IEmailConnector {
|
|
|
34
34
|
constructor({
|
|
35
35
|
API_KEY,
|
|
36
36
|
SMTP_HOST,
|
|
37
|
-
|
|
37
|
+
SENDER_EMAIL,
|
|
38
|
+
SENDER_NAME
|
|
38
39
|
}) {
|
|
39
40
|
this.API_KEY = API_KEY;
|
|
40
41
|
this.SMTP_HOST = SMTP_HOST;
|
|
41
|
-
this.
|
|
42
|
+
this.SENDER_EMAIL = SENDER_EMAIL;
|
|
43
|
+
this.SENDER_NAME = SENDER_NAME;
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
46
|
|
|
@@ -49,9 +51,10 @@ class EcomailConnector extends IEmailConnector {
|
|
|
49
51
|
constructor({
|
|
50
52
|
API_KEY,
|
|
51
53
|
SMTP_HOST,
|
|
52
|
-
|
|
54
|
+
SENDER_EMAIL,
|
|
55
|
+
SENDER_NAME
|
|
53
56
|
}) {
|
|
54
|
-
super({ API_KEY, SMTP_HOST,
|
|
57
|
+
super({ API_KEY, SMTP_HOST, SENDER_EMAIL, SENDER_NAME });
|
|
55
58
|
}
|
|
56
59
|
async sendEmail(email) {
|
|
57
60
|
if (email.templateVariables) {
|
|
@@ -78,7 +81,7 @@ class EcomailConnector extends IEmailConnector {
|
|
|
78
81
|
const ccContacts = email.cc ? this.convertContacts(email.cc) : [];
|
|
79
82
|
const bccContacts = email.bcc ? this.convertContacts(email.bcc) : [];
|
|
80
83
|
const replyTo = email.replyTo ? this.convertContacts(email.replyTo)[0] : void 0;
|
|
81
|
-
const from = this.convertContact(email.from || this.
|
|
84
|
+
const from = this.convertContact(email.from || this.SENDER_EMAIL);
|
|
82
85
|
const subject = email.subject;
|
|
83
86
|
const attachments = [];
|
|
84
87
|
const contacts = toContacts.flatMap((to) => {
|
|
@@ -53,11 +53,13 @@ declare abstract class IEmailConnector {
|
|
|
53
53
|
static providerName: string;
|
|
54
54
|
API_KEY: string;
|
|
55
55
|
SMTP_HOST: string;
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
SENDER_EMAIL: string;
|
|
57
|
+
SENDER_NAME: string;
|
|
58
|
+
protected constructor({ API_KEY, SMTP_HOST, SENDER_EMAIL, SENDER_NAME, }: {
|
|
58
59
|
API_KEY: string;
|
|
59
60
|
SMTP_HOST: string;
|
|
60
|
-
|
|
61
|
+
SENDER_EMAIL: string;
|
|
62
|
+
SENDER_NAME: string;
|
|
61
63
|
});
|
|
62
64
|
abstract sendEmail(email: IEmail): Promise<void>;
|
|
63
65
|
}
|
|
@@ -199,4 +201,4 @@ interface ISlack {
|
|
|
199
201
|
declare const tables: typeof schema;
|
|
200
202
|
|
|
201
203
|
export { IEmailConnector as I, ISmsConnector as a, iContactSchema as j, iEmailSchema as k, sendSlackInputSchema as l, sendSmsInputSchema as m, sendEmailInputSchema as s, tables as t };
|
|
202
|
-
export type { NotificationQueueMessage as N, SendEmailInput as S, SendEmailOutput as b, SendSmsInput as c, SendSmsOutput as d, SendSlackInput as e, SendSlackOutput as f,
|
|
204
|
+
export type { NotificationQueueMessage as N, SendEmailInput as S, SendEmailOutput as b, SendSmsInput as c, SendSmsOutput as d, SendSlackInput as e, SendSlackOutput as f, IEmail as g, IContact as h, ISms as i, IPushNotification as n, ISlack as o };
|
|
@@ -27,11 +27,13 @@ class IEmailConnector {
|
|
|
27
27
|
constructor({
|
|
28
28
|
API_KEY,
|
|
29
29
|
SMTP_HOST,
|
|
30
|
-
|
|
30
|
+
SENDER_EMAIL,
|
|
31
|
+
SENDER_NAME
|
|
31
32
|
}) {
|
|
32
33
|
this.API_KEY = API_KEY;
|
|
33
34
|
this.SMTP_HOST = SMTP_HOST;
|
|
34
|
-
this.
|
|
35
|
+
this.SENDER_EMAIL = SENDER_EMAIL;
|
|
36
|
+
this.SENDER_NAME = SENDER_NAME;
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
39
|
|
|
@@ -42,9 +44,10 @@ class EcomailConnector extends IEmailConnector {
|
|
|
42
44
|
constructor({
|
|
43
45
|
API_KEY,
|
|
44
46
|
SMTP_HOST,
|
|
45
|
-
|
|
47
|
+
SENDER_EMAIL,
|
|
48
|
+
SENDER_NAME
|
|
46
49
|
}) {
|
|
47
|
-
super({ API_KEY, SMTP_HOST,
|
|
50
|
+
super({ API_KEY, SMTP_HOST, SENDER_EMAIL, SENDER_NAME });
|
|
48
51
|
}
|
|
49
52
|
async sendEmail(email) {
|
|
50
53
|
if (email.templateVariables) {
|
|
@@ -71,7 +74,7 @@ class EcomailConnector extends IEmailConnector {
|
|
|
71
74
|
const ccContacts = email.cc ? this.convertContacts(email.cc) : [];
|
|
72
75
|
const bccContacts = email.bcc ? this.convertContacts(email.bcc) : [];
|
|
73
76
|
const replyTo = email.replyTo ? this.convertContacts(email.replyTo)[0] : void 0;
|
|
74
|
-
const from = this.convertContact(email.from || this.
|
|
77
|
+
const from = this.convertContact(email.from || this.SENDER_EMAIL);
|
|
75
78
|
const subject = email.subject;
|
|
76
79
|
const attachments = [];
|
|
77
80
|
const contacts = toContacts.flatMap((to) => {
|
|
@@ -53,11 +53,13 @@ declare abstract class IEmailConnector {
|
|
|
53
53
|
static providerName: string;
|
|
54
54
|
API_KEY: string;
|
|
55
55
|
SMTP_HOST: string;
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
SENDER_EMAIL: string;
|
|
57
|
+
SENDER_NAME: string;
|
|
58
|
+
protected constructor({ API_KEY, SMTP_HOST, SENDER_EMAIL, SENDER_NAME, }: {
|
|
58
59
|
API_KEY: string;
|
|
59
60
|
SMTP_HOST: string;
|
|
60
|
-
|
|
61
|
+
SENDER_EMAIL: string;
|
|
62
|
+
SENDER_NAME: string;
|
|
61
63
|
});
|
|
62
64
|
abstract sendEmail(email: IEmail): Promise<void>;
|
|
63
65
|
}
|
|
@@ -199,4 +201,4 @@ interface ISlack {
|
|
|
199
201
|
declare const tables: typeof schema;
|
|
200
202
|
|
|
201
203
|
export { IEmailConnector as I, ISmsConnector as a, iContactSchema as j, iEmailSchema as k, sendSlackInputSchema as l, sendSmsInputSchema as m, sendEmailInputSchema as s, tables as t };
|
|
202
|
-
export type { NotificationQueueMessage as N, SendEmailInput as S, SendEmailOutput as b, SendSmsInput as c, SendSmsOutput as d, SendSlackInput as e, SendSlackOutput as f,
|
|
204
|
+
export type { NotificationQueueMessage as N, SendEmailInput as S, SendEmailOutput as b, SendSmsInput as c, SendSmsOutput as d, SendSlackInput as e, SendSlackOutput as f, IEmail as g, IContact as h, ISms as i, IPushNotification as n, ISlack as o };
|
|
@@ -53,11 +53,13 @@ declare abstract class IEmailConnector {
|
|
|
53
53
|
static providerName: string;
|
|
54
54
|
API_KEY: string;
|
|
55
55
|
SMTP_HOST: string;
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
SENDER_EMAIL: string;
|
|
57
|
+
SENDER_NAME: string;
|
|
58
|
+
protected constructor({ API_KEY, SMTP_HOST, SENDER_EMAIL, SENDER_NAME, }: {
|
|
58
59
|
API_KEY: string;
|
|
59
60
|
SMTP_HOST: string;
|
|
60
|
-
|
|
61
|
+
SENDER_EMAIL: string;
|
|
62
|
+
SENDER_NAME: string;
|
|
61
63
|
});
|
|
62
64
|
abstract sendEmail(email: IEmail): Promise<void>;
|
|
63
65
|
}
|
|
@@ -199,4 +201,4 @@ interface ISlack {
|
|
|
199
201
|
declare const tables: typeof schema;
|
|
200
202
|
|
|
201
203
|
export { IEmailConnector as I, ISmsConnector as a, iContactSchema as j, iEmailSchema as k, sendSlackInputSchema as l, sendSmsInputSchema as m, sendEmailInputSchema as s, tables as t };
|
|
202
|
-
export type { NotificationQueueMessage as N, SendEmailInput as S, SendEmailOutput as b, SendSmsInput as c, SendSmsOutput as d, SendSlackInput as e, SendSlackOutput as f,
|
|
204
|
+
export type { NotificationQueueMessage as N, SendEmailInput as S, SendEmailOutput as b, SendSmsInput as c, SendSmsOutput as d, SendSlackInput as e, SendSlackOutput as f, IEmail as g, IContact as h, ISms as i, IPushNotification as n, ISlack as o };
|