@spinajs/email 2.0.180 → 2.0.182

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.
Files changed (47) hide show
  1. package/lib/cjs/cli/SendEmail.d.ts +16 -16
  2. package/lib/cjs/cli/SendEmail.js +82 -82
  3. package/lib/cjs/cli/SendEmail.js.map +1 -1
  4. package/lib/cjs/config/email.d.ts +28 -28
  5. package/lib/cjs/config/email.js +35 -35
  6. package/lib/cjs/events/EmailSent.d.ts +23 -23
  7. package/lib/cjs/events/EmailSent.js +32 -32
  8. package/lib/cjs/events/EmailSent.js.map +1 -1
  9. package/lib/cjs/index.d.ts +23 -23
  10. package/lib/cjs/index.js +76 -76
  11. package/lib/cjs/index.js.map +1 -1
  12. package/lib/cjs/interfaces.d.ts +114 -114
  13. package/lib/cjs/interfaces.js +44 -44
  14. package/lib/cjs/interfaces.js.map +1 -1
  15. package/lib/cjs/jobs/EmailSend.d.ts +30 -30
  16. package/lib/cjs/jobs/EmailSend.js +36 -36
  17. package/lib/cjs/jobs/EmailSend.js.map +1 -1
  18. package/lib/cjs/schemas/email.smtp.configuration.d.ts +52 -52
  19. package/lib/cjs/schemas/email.smtp.configuration.js +38 -38
  20. package/lib/cjs/transports.d.ts +9 -9
  21. package/lib/cjs/transports.js +24 -24
  22. package/lib/cjs/transports.js.map +1 -1
  23. package/lib/mjs/cli/SendEmail.d.ts +16 -16
  24. package/lib/mjs/cli/SendEmail.js +56 -56
  25. package/lib/mjs/cli/SendEmail.js.map +1 -1
  26. package/lib/mjs/config/email.d.ts +28 -28
  27. package/lib/mjs/config/email.js +33 -33
  28. package/lib/mjs/events/EmailSent.d.ts +23 -23
  29. package/lib/mjs/events/EmailSent.js +29 -29
  30. package/lib/mjs/events/EmailSent.js.map +1 -1
  31. package/lib/mjs/index.d.ts +23 -23
  32. package/lib/mjs/index.js +56 -56
  33. package/lib/mjs/index.js.map +1 -1
  34. package/lib/mjs/interfaces.d.ts +114 -114
  35. package/lib/mjs/interfaces.js +39 -39
  36. package/lib/mjs/interfaces.js.map +1 -1
  37. package/lib/mjs/jobs/EmailSend.d.ts +30 -30
  38. package/lib/mjs/jobs/EmailSend.js +33 -33
  39. package/lib/mjs/jobs/EmailSend.js.map +1 -1
  40. package/lib/mjs/schemas/email.smtp.configuration.d.ts +52 -52
  41. package/lib/mjs/schemas/email.smtp.configuration.js +36 -36
  42. package/lib/mjs/transports.d.ts +9 -9
  43. package/lib/mjs/transports.js +21 -21
  44. package/lib/mjs/transports.js.map +1 -1
  45. package/lib/tsconfig.cjs.tsbuildinfo +1 -1
  46. package/lib/tsconfig.mjs.tsbuildinfo +1 -1
  47. package/package.json +8 -8
@@ -1,53 +1,53 @@
1
- declare const CONFIGURATION_SCHEMA: {
2
- $id: string;
3
- $configurationModule: string;
4
- description: string;
5
- type: string;
6
- properties: {
7
- queue: string;
8
- connections: {
9
- type: string;
10
- uniqueItems: boolean;
11
- items: {
12
- type: string;
13
- properties: {
14
- ssl: {
15
- type: string;
16
- };
17
- host: {
18
- type: string;
19
- };
20
- port: {
21
- type: string;
22
- };
23
- user: {
24
- type: string;
25
- };
26
- password: {
27
- type: string;
28
- };
29
- name: {
30
- type: string;
31
- };
32
- sender: {
33
- type: string;
34
- };
35
- options: {
36
- type: string;
37
- };
38
- defaults: {
39
- type: string;
40
- properties: {
41
- mailFrom: {
42
- type: string;
43
- };
44
- };
45
- };
46
- };
47
- };
48
- };
49
- };
50
- required: string[];
51
- };
52
- export default CONFIGURATION_SCHEMA;
1
+ declare const CONFIGURATION_SCHEMA: {
2
+ $id: string;
3
+ $configurationModule: string;
4
+ description: string;
5
+ type: string;
6
+ properties: {
7
+ queue: string;
8
+ connections: {
9
+ type: string;
10
+ uniqueItems: boolean;
11
+ items: {
12
+ type: string;
13
+ properties: {
14
+ ssl: {
15
+ type: string;
16
+ };
17
+ host: {
18
+ type: string;
19
+ };
20
+ port: {
21
+ type: string;
22
+ };
23
+ user: {
24
+ type: string;
25
+ };
26
+ password: {
27
+ type: string;
28
+ };
29
+ name: {
30
+ type: string;
31
+ };
32
+ sender: {
33
+ type: string;
34
+ };
35
+ options: {
36
+ type: string;
37
+ };
38
+ defaults: {
39
+ type: string;
40
+ properties: {
41
+ mailFrom: {
42
+ type: string;
43
+ };
44
+ };
45
+ };
46
+ };
47
+ };
48
+ };
49
+ };
50
+ required: string[];
51
+ };
52
+ export default CONFIGURATION_SCHEMA;
53
53
  //# sourceMappingURL=email.smtp.configuration.d.ts.map
@@ -1,39 +1,39 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const CONFIGURATION_SCHEMA = {
4
- $id: 'spinajs/email.configuration.schema.json',
5
- $configurationModule: 'email',
6
- description: 'Email smtp transport configuration option validation',
7
- type: 'object',
8
- properties: {
9
- queue: 'string',
10
- connections: {
11
- type: 'array',
12
- uniqueItems: true,
13
- items: {
14
- type: 'object',
15
- properties: {
16
- ssl: { type: 'boolean' },
17
- host: { type: 'string' },
18
- port: { type: 'number' },
19
- user: { type: 'string' },
20
- password: { type: 'string' },
21
- name: { type: 'string' },
22
- sender: { type: 'string' },
23
- options: {
24
- type: 'object',
25
- },
26
- defaults: {
27
- type: 'object',
28
- properties: {
29
- mailFrom: { type: 'string' },
30
- },
31
- },
32
- },
33
- },
34
- },
35
- },
36
- required: ['name', 'sender'],
37
- };
38
- exports.default = CONFIGURATION_SCHEMA;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const CONFIGURATION_SCHEMA = {
4
+ $id: 'spinajs/email.configuration.schema.json',
5
+ $configurationModule: 'email',
6
+ description: 'Email smtp transport configuration option validation',
7
+ type: 'object',
8
+ properties: {
9
+ queue: 'string',
10
+ connections: {
11
+ type: 'array',
12
+ uniqueItems: true,
13
+ items: {
14
+ type: 'object',
15
+ properties: {
16
+ ssl: { type: 'boolean' },
17
+ host: { type: 'string' },
18
+ port: { type: 'number' },
19
+ user: { type: 'string' },
20
+ password: { type: 'string' },
21
+ name: { type: 'string' },
22
+ sender: { type: 'string' },
23
+ options: {
24
+ type: 'object',
25
+ },
26
+ defaults: {
27
+ type: 'object',
28
+ properties: {
29
+ mailFrom: { type: 'string' },
30
+ },
31
+ },
32
+ },
33
+ },
34
+ },
35
+ },
36
+ required: ['name', 'sender'],
37
+ };
38
+ exports.default = CONFIGURATION_SCHEMA;
39
39
  //# sourceMappingURL=email.smtp.configuration.js.map
@@ -1,10 +1,10 @@
1
- import { EmailSender } from './interfaces.js';
2
- /**
3
- * Transport that does nothing.
4
- *
5
- * Used for testing, or when we want temporarly disable siding emails
6
- */
7
- export declare class BlackHoleEmailTransport extends EmailSender {
8
- send(): Promise<void>;
9
- }
1
+ import { EmailSender } from './interfaces.js';
2
+ /**
3
+ * Transport that does nothing.
4
+ *
5
+ * Used for testing, or when we want temporarly disable siding emails
6
+ */
7
+ export declare class BlackHoleEmailTransport extends EmailSender {
8
+ send(): Promise<void>;
9
+ }
10
10
  //# sourceMappingURL=transports.d.ts.map
@@ -1,25 +1,25 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.BlackHoleEmailTransport = void 0;
10
- const di_1 = require("@spinajs/di");
11
- const interfaces_js_1 = require("./interfaces.js");
12
- /**
13
- * Transport that does nothing.
14
- *
15
- * Used for testing, or when we want temporarly disable siding emails
16
- */
17
- let BlackHoleEmailTransport = class BlackHoleEmailTransport extends interfaces_js_1.EmailSender {
18
- async send() { }
19
- };
20
- BlackHoleEmailTransport = __decorate([
21
- (0, di_1.Injectable)(),
22
- (0, di_1.NewInstance)()
23
- ], BlackHoleEmailTransport);
24
- exports.BlackHoleEmailTransport = BlackHoleEmailTransport;
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.BlackHoleEmailTransport = void 0;
10
+ const di_1 = require("@spinajs/di");
11
+ const interfaces_js_1 = require("./interfaces.js");
12
+ /**
13
+ * Transport that does nothing.
14
+ *
15
+ * Used for testing, or when we want temporarly disable siding emails
16
+ */
17
+ let BlackHoleEmailTransport = class BlackHoleEmailTransport extends interfaces_js_1.EmailSender {
18
+ async send() { }
19
+ };
20
+ exports.BlackHoleEmailTransport = BlackHoleEmailTransport;
21
+ exports.BlackHoleEmailTransport = BlackHoleEmailTransport = __decorate([
22
+ (0, di_1.Injectable)(),
23
+ (0, di_1.NewInstance)()
24
+ ], BlackHoleEmailTransport);
25
25
  //# sourceMappingURL=transports.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transports.js","sourceRoot":"","sources":["../../src/transports.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oCAAsD;AACtD,mDAA8C;AAE9C;;;;GAIG;AAGI,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,2BAAW;IAC/C,KAAK,CAAC,IAAI,KAAmB,CAAC;CACtC,CAAA;AAFY,uBAAuB;IAFnC,IAAA,eAAU,GAAE;IACZ,IAAA,gBAAW,GAAE;GACD,uBAAuB,CAEnC;AAFY,0DAAuB"}
1
+ {"version":3,"file":"transports.js","sourceRoot":"","sources":["../../src/transports.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oCAAsD;AACtD,mDAA8C;AAE9C;;;;GAIG;AAGI,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,2BAAW;IAC/C,KAAK,CAAC,IAAI,KAAmB,CAAC;CACtC,CAAA;AAFY,0DAAuB;kCAAvB,uBAAuB;IAFnC,IAAA,eAAU,GAAE;IACZ,IAAA,gBAAW,GAAE;GACD,uBAAuB,CAEnC"}
@@ -1,17 +1,17 @@
1
- import { CliCommand } from '@spinajs/cli';
2
- import { Log } from '@spinajs/log-common';
3
- interface EmailOptions {
4
- connection: string;
5
- from: string;
6
- to: string;
7
- template?: string;
8
- model?: string;
9
- subject: string;
10
- content?: string;
11
- }
12
- export declare class SendEmailCommand extends CliCommand {
13
- protected Log: Log;
14
- execute(options: EmailOptions): Promise<void>;
15
- }
16
- export {};
1
+ import { CliCommand } from '@spinajs/cli';
2
+ import { Log } from '@spinajs/log-common';
3
+ interface EmailOptions {
4
+ connection: string;
5
+ from: string;
6
+ to: string;
7
+ template?: string;
8
+ model?: string;
9
+ subject: string;
10
+ content?: string;
11
+ }
12
+ export declare class SendEmailCommand extends CliCommand {
13
+ protected Log: Log;
14
+ execute(options: EmailOptions): Promise<void>;
15
+ }
16
+ export {};
17
17
  //# sourceMappingURL=SendEmail.d.ts.map
@@ -1,57 +1,57 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- import { CliCommand, Command, Option } from '@spinajs/cli';
11
- import { DI } from '@spinajs/di';
12
- import * as fs from 'fs';
13
- import { Logger, Log } from '@spinajs/log-common';
14
- import { DefaultEmailService } from './../index.js';
15
- let SendEmailCommand = class SendEmailCommand extends CliCommand {
16
- async execute(options) {
17
- this.Log.trace(`Sending email with options options: ${JSON.stringify(options)}`);
18
- try {
19
- const emails = await DI.resolve(DefaultEmailService);
20
- let model = {};
21
- if (options.model && fs.existsSync(options.model)) {
22
- this.Log.trace(`Found model file at ${options.model}, trying to load model data ... `);
23
- const mText = fs.readFileSync(options.model, { encoding: 'utf-8' });
24
- model = JSON.parse(mText);
25
- }
26
- await emails.send({
27
- from: options.from,
28
- to: options.to.split(','),
29
- connection: options.connection,
30
- template: options.template,
31
- model: model,
32
- subject: options.subject,
33
- text: options.content,
34
- });
35
- this.Log.success(`Email send succesyfully to: ${options.to}, from: ${options.from}, subject: ${options.subject}`);
36
- }
37
- catch (err) {
38
- this.Log.error(`Cannot send email, reason: ${err.message}, stack: ${err.stack}`);
39
- }
40
- }
41
- };
42
- __decorate([
43
- Logger('email'),
44
- __metadata("design:type", Log)
45
- ], SendEmailCommand.prototype, "Log", void 0);
46
- SendEmailCommand = __decorate([
47
- Command('email-send', 'Sends email, mainly for testing purpose or scheduled tasks'),
48
- Option('-c, --connection [connection]', true, 'name of connection'),
49
- Option('-f, --from [from]', true, 'from email'),
50
- Option('-t, --to [to]', true, 'receipients, can be many ( comma separated )'),
51
- Option('-e, --template [template]', false, 'template name'),
52
- Option('-m, --model [model]', false, 'path to model data for template, in json format'),
53
- Option('-s, --subject [model]', true, 'subject'),
54
- Option('-c, --content [content]', false, 'text content if template is not provided')
55
- ], SendEmailCommand);
56
- export { SendEmailCommand };
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { CliCommand, Command, Option } from '@spinajs/cli';
11
+ import { DI } from '@spinajs/di';
12
+ import * as fs from 'fs';
13
+ import { Logger, Log } from '@spinajs/log-common';
14
+ import { DefaultEmailService } from './../index.js';
15
+ let SendEmailCommand = class SendEmailCommand extends CliCommand {
16
+ async execute(options) {
17
+ this.Log.trace(`Sending email with options options: ${JSON.stringify(options)}`);
18
+ try {
19
+ const emails = await DI.resolve(DefaultEmailService);
20
+ let model = {};
21
+ if (options.model && fs.existsSync(options.model)) {
22
+ this.Log.trace(`Found model file at ${options.model}, trying to load model data ... `);
23
+ const mText = fs.readFileSync(options.model, { encoding: 'utf-8' });
24
+ model = JSON.parse(mText);
25
+ }
26
+ await emails.send({
27
+ from: options.from,
28
+ to: options.to.split(','),
29
+ connection: options.connection,
30
+ template: options.template,
31
+ model: model,
32
+ subject: options.subject,
33
+ text: options.content,
34
+ });
35
+ this.Log.success(`Email send succesyfully to: ${options.to}, from: ${options.from}, subject: ${options.subject}`);
36
+ }
37
+ catch (err) {
38
+ this.Log.error(`Cannot send email, reason: ${err.message}, stack: ${err.stack}`);
39
+ }
40
+ }
41
+ };
42
+ __decorate([
43
+ Logger('email'),
44
+ __metadata("design:type", Log)
45
+ ], SendEmailCommand.prototype, "Log", void 0);
46
+ SendEmailCommand = __decorate([
47
+ Command('email-send', 'Sends email, mainly for testing purpose or scheduled tasks'),
48
+ Option('-c, --connection [connection]', true, 'name of connection'),
49
+ Option('-f, --from [from]', true, 'from email'),
50
+ Option('-t, --to [to]', true, 'receipients, can be many ( comma separated )'),
51
+ Option('-e, --template [template]', false, 'template name'),
52
+ Option('-m, --model [model]', false, 'path to model data for template, in json format'),
53
+ Option('-s, --subject [model]', true, 'subject'),
54
+ Option('-c, --content [content]', false, 'text content if template is not provided')
55
+ ], SendEmailCommand);
56
+ export { SendEmailCommand };
57
57
  //# sourceMappingURL=SendEmail.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SendEmail.js","sourceRoot":"","sources":["../../../src/cli/SendEmail.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAoB7C,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU;IAIvC,KAAK,CAAC,OAAO,CAAC,OAAqB;QACxC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,uCAAuC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAEjF,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;YACrD,IAAI,KAAK,GAAG,EAAE,CAAC;YAEf,IAAI,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBACjD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,uBAAuB,OAAO,CAAC,KAAK,kCAAkC,CAAC,CAAC;gBAEvF,MAAM,KAAK,GAAG,EAA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{
9
- queue: string;
10
- };
11
- queue: {
12
- routing: {
13
- EmailSendJob: {
14
- connection: string;
15
- };
16
- EmailSent: {
17
- connection: string;
18
- };
19
- };
20
- connections: {
21
- name: string;
22
- service: string;
23
- defaultQueueChannel: string;
24
- defaultTopicChannel: string;
25
- }[];
26
- };
27
- };
28
- export default email;
1
+ declare const email: {
2
+ system: {
3
+ dirs: {
4
+ cli: string[];
5
+ jobs: string[];
6
+ };
7
+ };
8
+ email: {
9
+ queue: string;
10
+ };
11
+ queue: {
12
+ routing: {
13
+ EmailSendJob: {
14
+ connection: string;
15
+ };
16
+ EmailSent: {
17
+ connection: string;
18
+ };
19
+ };
20
+ connections: {
21
+ name: string;
22
+ service: string;
23
+ defaultQueueChannel: string;
24
+ defaultTopicChannel: string;
25
+ }[];
26
+ };
27
+ };
28
+ export default email;
29
29
  //# sourceMappingURL=email.d.ts.map
@@ -1,34 +1,34 @@
1
- import { join, normalize, resolve } from 'path';
2
- function dir(path) {
3
- const inCommonJs = typeof module !== 'undefined';
4
- return resolve(normalize(join(process.cwd(), 'node_modules', '@spinajs', 'email', 'lib', inCommonJs ? 'cjs' : 'mjs', path)));
5
- }
6
- const email = {
7
- system: {
8
- dirs: {
9
- cli: [dir('cli')],
10
- jobs: [dir('jobs')],
11
- },
12
- },
13
- email: {
14
- // default email queue / transport
15
- queue: 'email-queue-black-hole',
16
- },
17
- queue: {
18
- routing: {
19
- EmailSendJob: { connection: 'email-queue-black-hole' },
20
- EmailSent: { connection: 'email-queue-black-hole' },
21
- },
22
- // by default we dont have queue server for sending emails
23
- connections: [
24
- {
25
- name: 'email-queue-black-hole',
26
- service: 'BlackHoleQueueClient',
27
- defaultQueueChannel: 'email-jobs',
28
- defaultTopicChannel: 'email-events',
29
- },
30
- ],
31
- },
32
- };
33
- export default email;
1
+ import { join, normalize, resolve } from 'path';
2
+ function dir(path) {
3
+ const inCommonJs = typeof module !== 'undefined';
4
+ return resolve(normalize(join(process.cwd(), 'node_modules', '@spinajs', 'email', 'lib', inCommonJs ? 'cjs' : 'mjs', path)));
5
+ }
6
+ const email = {
7
+ system: {
8
+ dirs: {
9
+ cli: [dir('cli')],
10
+ jobs: [dir('jobs')],
11
+ },
12
+ },
13
+ email: {
14
+ // default email queue / transport
15
+ queue: 'email-queue-black-hole',
16
+ },
17
+ queue: {
18
+ routing: {
19
+ EmailSendJob: { connection: 'email-queue-black-hole' },
20
+ EmailSent: { connection: 'email-queue-black-hole' },
21
+ },
22
+ // by default we dont have queue server for sending emails
23
+ connections: [
24
+ {
25
+ name: 'email-queue-black-hole',
26
+ service: 'BlackHoleQueueClient',
27
+ defaultQueueChannel: 'email-jobs',
28
+ defaultTopicChannel: 'email-events',
29
+ },
30
+ ],
31
+ },
32
+ };
33
+ export default email;
34
34
  //# sourceMappingURL=email.js.map
@@ -1,24 +1,24 @@
1
- import { QueueEvent } from '@spinajs/queue';
2
- import { DateTime } from 'luxon';
3
- import { IEmail } from '../interfaces.js';
4
- export declare class EmailSent extends QueueEvent {
5
- Connection?: string;
6
- From: string;
7
- To: string[];
8
- /**
9
- * Email template eg. pug file or mustashe
10
- */
11
- Template?: string;
12
- /**
13
- * Data model used in template
14
- */
15
- Model?: any;
16
- Subject: string;
17
- /**
18
- * text content if template is not provided
19
- */
20
- Content?: string;
21
- SentAt: DateTime;
22
- constructor(email: IEmail);
23
- }
1
+ import { QueueEvent } from '@spinajs/queue';
2
+ import { DateTime } from 'luxon';
3
+ import { IEmail } from '../interfaces.js';
4
+ export declare class EmailSent extends QueueEvent {
5
+ Connection?: string;
6
+ From: string;
7
+ To: string[];
8
+ /**
9
+ * Email template eg. pug file or mustashe
10
+ */
11
+ Template?: string;
12
+ /**
13
+ * Data model used in template
14
+ */
15
+ Model?: any;
16
+ Subject: string;
17
+ /**
18
+ * text content if template is not provided
19
+ */
20
+ Content?: string;
21
+ SentAt: DateTime;
22
+ constructor(email: IEmail);
23
+ }
24
24
  //# sourceMappingURL=EmailSent.d.ts.map