@pearl-framework/mail 0.1.1 → 0.1.3
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/.turbo/turbo-build.log
CHANGED
package/dist/mail/Mailable.d.ts
CHANGED
|
@@ -29,20 +29,17 @@ export interface BuiltMail extends MailContent {
|
|
|
29
29
|
*
|
|
30
30
|
* Usage:
|
|
31
31
|
* export class WelcomeEmail extends Mailable {
|
|
32
|
-
* constructor(private readonly
|
|
32
|
+
* constructor(private readonly to: string, private readonly name: string) {
|
|
33
33
|
* super()
|
|
34
34
|
* }
|
|
35
35
|
*
|
|
36
36
|
* build(): this {
|
|
37
37
|
* return this
|
|
38
|
-
* .
|
|
38
|
+
* .sendTo(this.to)
|
|
39
39
|
* .subject('Welcome to Pearl!')
|
|
40
|
-
* .html(`<h1>Hi
|
|
40
|
+
* .html(`<h1>Hi ${this.name}!</h1>`)
|
|
41
41
|
* }
|
|
42
42
|
* }
|
|
43
|
-
*
|
|
44
|
-
* Note: Do not use 'to' as a constructor parameter name in subclasses —
|
|
45
|
-
* it conflicts with the Mailable.to() builder method. Use 'recipient' instead.
|
|
46
43
|
*/
|
|
47
44
|
export declare abstract class Mailable {
|
|
48
45
|
protected _from?: MailAddress | string;
|
|
@@ -55,7 +52,11 @@ export declare abstract class Mailable {
|
|
|
55
52
|
protected _text?: string;
|
|
56
53
|
protected _attachments: Attachment[];
|
|
57
54
|
from(address: MailAddress | string): this;
|
|
58
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Set the recipient(s) of the email.
|
|
57
|
+
* Named 'sendTo' to avoid conflicts with subclass properties named 'to'.
|
|
58
|
+
*/
|
|
59
|
+
sendTo(...addresses: Array<MailAddress | string>): this;
|
|
59
60
|
cc(...addresses: Array<MailAddress | string>): this;
|
|
60
61
|
bcc(...addresses: Array<MailAddress | string>): this;
|
|
61
62
|
replyTo(address: MailAddress | string): this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mailable.d.ts","sourceRoot":"","sources":["../../src/mail/Mailable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAEhE,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,CAAA;IAC3B,EAAE,EAAE,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC,CAAA;IAC/B,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC,CAAA;IAChC,GAAG,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC,CAAA;IACjC,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,CAAA;IAC9B,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,UAAU,EAAE,CAAA;CAC3B;AAED,MAAM,WAAW,SAAU,SAAQ,WAAW;IAC5C,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,CAAA;IAC3B,EAAE,EAAE,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC,CAAA;IAC/B,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC,CAAA;IAChC,GAAG,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC,CAAA;IACjC,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,CAAA;IAC9B,OAAO,EAAE,MAAM,CAAA;CAChB;AAED
|
|
1
|
+
{"version":3,"file":"Mailable.d.ts","sourceRoot":"","sources":["../../src/mail/Mailable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAEhE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-
* constructor(private readonly
|
|
6
|
+
* constructor(private readonly to: string, private readonly name: string) {
|
|
7
7
|
* super()
|
|
8
8
|
* }
|
|
9
9
|
*
|
|
10
10
|
* build(): this {
|
|
11
11
|
* return this
|
|
12
|
-
* .
|
|
12
|
+
* .sendTo(this.to)
|
|
13
13
|
* .subject('Welcome to Pearl!')
|
|
14
|
-
* .html(`<h1>Hi
|
|
14
|
+
* .html(`<h1>Hi ${this.name}!</h1>`)
|
|
15
15
|
* }
|
|
16
16
|
* }
|
|
17
|
-
*
|
|
18
|
-
* Note: Do not use 'to' as a constructor parameter name in subclasses —
|
|
19
|
-
* it conflicts with the Mailable.to() builder method. Use 'recipient' instead.
|
|
20
17
|
*/
|
|
21
18
|
export class Mailable {
|
|
22
19
|
_from;
|
|
@@ -33,7 +30,11 @@ export class Mailable {
|
|
|
33
30
|
this._from = address;
|
|
34
31
|
return this;
|
|
35
32
|
}
|
|
36
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Set the recipient(s) of the email.
|
|
35
|
+
* Named 'sendTo' to avoid conflicts with subclass properties named 'to'.
|
|
36
|
+
*/
|
|
37
|
+
sendTo(...addresses) {
|
|
37
38
|
this._to.push(...addresses);
|
|
38
39
|
return this;
|
|
39
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mailable.js","sourceRoot":"","sources":["../../src/mail/Mailable.ts"],"names":[],"mappings":"AA+BA
|
|
1
|
+
{"version":3,"file":"Mailable.js","sourceRoot":"","sources":["../../src/mail/Mailable.ts"],"names":[],"mappings":"AA+BA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAgB,QAAQ;IAClB,KAAK,CAAuB;IAC5B,GAAG,GAAgC,EAAE,CAAA;IACrC,GAAG,GAAgC,EAAE,CAAA;IACrC,IAAI,GAAgC,EAAE,CAAA;IACtC,QAAQ,CAAuB;IAC/B,QAAQ,GAAG,EAAE,CAAA;IACb,KAAK,CAAS;IACd,KAAK,CAAS;IACd,YAAY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ACL,GAAG,CAAC,IAAI,KAAK,SAAS,IAAI,EAAE,IAAI,EAAE,CAAC;YACnC,EAAE,EAAE,IAAI,CAAC,GAAG;YACZ,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC;YACxC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;YAC3C,GAAG,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC9D,OAAO,EAAE,IAAI,CAAC,QAAQ;YACtB,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;YACrD,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;YACrD,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC;SACpE,CAAA;IACH,CAAC;IAED,6EAA6E;IAE7E,WAAW;QACT,OAAO,KAAK,CAAA;IACd,CAAC;IAED,IAAI,KAAK;QACP,OAAO,MAAM,CAAA;IACf,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pearl-framework/mail",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Pearl.js mail — Nodemailer-powered mailable classes, transports, and queue support",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"url": "https://github.com/skd09/pearl.js.git",
|
|
38
38
|
"directory": "packages/mail"
|
|
39
39
|
},
|
|
40
|
+
"type": "module",
|
|
40
41
|
"scripts": {
|
|
41
42
|
"build": "tsc",
|
|
42
43
|
"dev": "tsc --watch",
|
package/src/mail/Mailable.ts
CHANGED
|
@@ -34,20 +34,17 @@ export interface BuiltMail extends MailContent {
|
|
|
34
34
|
*
|
|
35
35
|
* Usage:
|
|
36
36
|
* export class WelcomeEmail extends Mailable {
|
|
37
|
-
* constructor(private readonly
|
|
37
|
+
* constructor(private readonly to: string, private readonly name: string) {
|
|
38
38
|
* super()
|
|
39
39
|
* }
|
|
40
40
|
*
|
|
41
41
|
* build(): this {
|
|
42
42
|
* return this
|
|
43
|
-
* .
|
|
43
|
+
* .sendTo(this.to)
|
|
44
44
|
* .subject('Welcome to Pearl!')
|
|
45
|
-
* .html(`<h1>Hi
|
|
45
|
+
* .html(`<h1>Hi ${this.name}!</h1>`)
|
|
46
46
|
* }
|
|
47
47
|
* }
|
|
48
|
-
*
|
|
49
|
-
* Note: Do not use 'to' as a constructor parameter name in subclasses —
|
|
50
|
-
* it conflicts with the Mailable.to() builder method. Use 'recipient' instead.
|
|
51
48
|
*/
|
|
52
49
|
export abstract class Mailable {
|
|
53
50
|
protected _from?: MailAddress | string
|
|
@@ -67,7 +64,11 @@ export abstract class Mailable {
|
|
|
67
64
|
return this
|
|
68
65
|
}
|
|
69
66
|
|
|
70
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Set the recipient(s) of the email.
|
|
69
|
+
* Named 'sendTo' to avoid conflicts with subclass properties named 'to'.
|
|
70
|
+
*/
|
|
71
|
+
sendTo(...addresses: Array<MailAddress | string>): this {
|
|
71
72
|
this._to.push(...addresses)
|
|
72
73
|
return this
|
|
73
74
|
}
|