@h3ravel/mail 10.0.0 → 11.0.1
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/README.md +13 -1
- package/dist/index.cjs +291 -331
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +126 -116
- package/dist/index.d.ts +126 -116
- package/dist/index.js +265 -297
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -1,360 +1,320 @@
|
|
|
1
|
-
|
|
1
|
+
//#region rolldown:runtime
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
-
var __export = (target, all) => {
|
|
10
|
-
for (var name in all)
|
|
11
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
-
};
|
|
13
8
|
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
20
17
|
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
30
22
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
SendMailDriver: () => SendMailDriver,
|
|
41
|
-
Service: () => Service
|
|
42
|
-
});
|
|
43
|
-
module.exports = __toCommonJS(src_exports);
|
|
23
|
+
//#endregion
|
|
24
|
+
let nodemailer = require("nodemailer");
|
|
25
|
+
nodemailer = __toESM(nodemailer);
|
|
26
|
+
let stream = require("stream");
|
|
27
|
+
stream = __toESM(stream);
|
|
28
|
+
let __aws_sdk_client_sesv2 = require("@aws-sdk/client-sesv2");
|
|
29
|
+
__aws_sdk_client_sesv2 = __toESM(__aws_sdk_client_sesv2);
|
|
30
|
+
let __h3ravel_core = require("@h3ravel/core");
|
|
31
|
+
__h3ravel_core = __toESM(__h3ravel_core);
|
|
44
32
|
|
|
45
|
-
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
cc(...addresses) {
|
|
64
|
-
this.ccAddresses = addresses;
|
|
65
|
-
return this;
|
|
66
|
-
}
|
|
67
|
-
bcc(...addresses) {
|
|
68
|
-
this.bccAddresses = addresses;
|
|
69
|
-
return this;
|
|
70
|
-
}
|
|
71
|
-
subject(subject) {
|
|
72
|
-
this.subjectText = subject;
|
|
73
|
-
return this;
|
|
74
|
-
}
|
|
75
|
-
html(html) {
|
|
76
|
-
this.htmlContent = html;
|
|
77
|
-
return this;
|
|
78
|
-
}
|
|
79
|
-
text(text) {
|
|
80
|
-
this.textContent = text;
|
|
81
|
-
return this;
|
|
82
|
-
}
|
|
83
|
-
view(path, data = {}) {
|
|
84
|
-
this.viewPath = path;
|
|
85
|
-
this.viewData = data;
|
|
86
|
-
return this;
|
|
87
|
-
}
|
|
88
|
-
attach(filename, filePath) {
|
|
89
|
-
if (!this.attachmentsList)
|
|
90
|
-
this.attachmentsList = [];
|
|
91
|
-
this.attachmentsList.push({
|
|
92
|
-
filename,
|
|
93
|
-
path: filePath
|
|
94
|
-
});
|
|
95
|
-
return this;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Called internally by Mailer
|
|
99
|
-
*/
|
|
100
|
-
getMessageOptions() {
|
|
101
|
-
return {
|
|
102
|
-
to: this.toAddress,
|
|
103
|
-
cc: this.ccAddresses,
|
|
104
|
-
bcc: this.bccAddresses,
|
|
105
|
-
subject: this.subjectText,
|
|
106
|
-
html: this.htmlContent,
|
|
107
|
-
text: this.textContent,
|
|
108
|
-
viewPath: this.viewPath,
|
|
109
|
-
viewData: this.viewData,
|
|
110
|
-
attachments: this.attachmentsList
|
|
111
|
-
};
|
|
112
|
-
}
|
|
33
|
+
//#region src/Drivers/LOGDriver.ts
|
|
34
|
+
var LOGDriver = class {
|
|
35
|
+
transporter;
|
|
36
|
+
constructor(_config) {
|
|
37
|
+
this.transporter = nodemailer.default.createTransport({
|
|
38
|
+
streamTransport: true,
|
|
39
|
+
newline: "unix"
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
async send(options) {
|
|
43
|
+
this.transporter.sendMail(options, (err, info) => {
|
|
44
|
+
if (err) throw err;
|
|
45
|
+
console.log(info.envelope);
|
|
46
|
+
console.log(info.messageId);
|
|
47
|
+
info.message instanceof stream.default.Readable && info.message.pipe(process.stdout);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
113
50
|
};
|
|
114
51
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
}
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/Drivers/SendMailDriver.ts
|
|
54
|
+
var SendMailDriver = class {
|
|
55
|
+
transporter;
|
|
56
|
+
constructor(config) {
|
|
57
|
+
this.transporter = nodemailer.default.createTransport({
|
|
58
|
+
sendmail: true,
|
|
59
|
+
path: config.path
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
async send(options) {
|
|
63
|
+
return await this.transporter.sendMail({
|
|
64
|
+
to: options.to,
|
|
65
|
+
cc: options.cc,
|
|
66
|
+
bcc: options.bcc,
|
|
67
|
+
subject: options.subject,
|
|
68
|
+
html: options.html,
|
|
69
|
+
text: options.text,
|
|
70
|
+
attachments: options.attachments
|
|
71
|
+
});
|
|
72
|
+
}
|
|
138
73
|
};
|
|
139
74
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
var import_client_sesv2 = require("@aws-sdk/client-sesv2");
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/Drivers/SESDriver.ts
|
|
143
77
|
var SESDriver = class {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
attachments: options.attachments
|
|
175
|
-
});
|
|
176
|
-
}
|
|
78
|
+
transporter;
|
|
79
|
+
constructor(config) {
|
|
80
|
+
const sesClient = new __aws_sdk_client_sesv2.SESv2Client({
|
|
81
|
+
region: config.region,
|
|
82
|
+
credentials: {
|
|
83
|
+
accessKeyId: config.key,
|
|
84
|
+
sessionToken: config.token,
|
|
85
|
+
secretAccessKey: config.secret
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
this.transporter = nodemailer.default.createTransport({
|
|
89
|
+
SES: {
|
|
90
|
+
sesClient,
|
|
91
|
+
SendEmailCommand: __aws_sdk_client_sesv2.SendEmailCommand
|
|
92
|
+
},
|
|
93
|
+
maxConnections: config.maxConnections,
|
|
94
|
+
sendingRate: config.sendingRate
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
async send(options) {
|
|
98
|
+
return await this.transporter.sendMail({
|
|
99
|
+
to: options.to,
|
|
100
|
+
cc: options.cc,
|
|
101
|
+
bcc: options.bcc,
|
|
102
|
+
subject: options.subject,
|
|
103
|
+
html: options.html,
|
|
104
|
+
text: options.text,
|
|
105
|
+
attachments: options.attachments
|
|
106
|
+
});
|
|
107
|
+
}
|
|
177
108
|
};
|
|
178
109
|
|
|
179
|
-
|
|
180
|
-
|
|
110
|
+
//#endregion
|
|
111
|
+
//#region src/Drivers/SMTPDriver.ts
|
|
181
112
|
var SMTPDriver = class {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
attachments: options.attachments
|
|
206
|
-
});
|
|
207
|
-
}
|
|
113
|
+
transporter;
|
|
114
|
+
constructor(config) {
|
|
115
|
+
this.transporter = nodemailer.default.createTransport({
|
|
116
|
+
host: config.host,
|
|
117
|
+
port: config.port,
|
|
118
|
+
secure: config.port === 465,
|
|
119
|
+
auth: {
|
|
120
|
+
user: config.auth.user,
|
|
121
|
+
pass: config.auth.pass
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
async send(options) {
|
|
126
|
+
return await this.transporter.sendMail({
|
|
127
|
+
to: options.to,
|
|
128
|
+
cc: options.cc,
|
|
129
|
+
bcc: options.bcc,
|
|
130
|
+
subject: options.subject,
|
|
131
|
+
html: options.html,
|
|
132
|
+
text: options.text,
|
|
133
|
+
attachments: options.attachments
|
|
134
|
+
});
|
|
135
|
+
}
|
|
208
136
|
};
|
|
209
137
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
var
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
138
|
+
//#endregion
|
|
139
|
+
//#region src/Mailable.ts
|
|
140
|
+
var Mailable = class {
|
|
141
|
+
toAddress;
|
|
142
|
+
ccAddresses;
|
|
143
|
+
bccAddresses;
|
|
144
|
+
subjectText;
|
|
145
|
+
htmlContent;
|
|
146
|
+
textContent;
|
|
147
|
+
viewPath;
|
|
148
|
+
viewData;
|
|
149
|
+
attachmentsList;
|
|
150
|
+
to(address) {
|
|
151
|
+
this.toAddress = address;
|
|
152
|
+
return this;
|
|
153
|
+
}
|
|
154
|
+
cc(...addresses) {
|
|
155
|
+
this.ccAddresses = addresses;
|
|
156
|
+
return this;
|
|
157
|
+
}
|
|
158
|
+
bcc(...addresses) {
|
|
159
|
+
this.bccAddresses = addresses;
|
|
160
|
+
return this;
|
|
161
|
+
}
|
|
162
|
+
subject(subject) {
|
|
163
|
+
this.subjectText = subject;
|
|
164
|
+
return this;
|
|
165
|
+
}
|
|
166
|
+
html(html) {
|
|
167
|
+
this.htmlContent = html;
|
|
168
|
+
return this;
|
|
169
|
+
}
|
|
170
|
+
text(text) {
|
|
171
|
+
this.textContent = text;
|
|
172
|
+
return this;
|
|
173
|
+
}
|
|
174
|
+
view(path, data = {}) {
|
|
175
|
+
this.viewPath = path;
|
|
176
|
+
this.viewData = data;
|
|
177
|
+
return this;
|
|
178
|
+
}
|
|
179
|
+
attach(filename, filePath) {
|
|
180
|
+
if (!this.attachmentsList) this.attachmentsList = [];
|
|
181
|
+
this.attachmentsList.push({
|
|
182
|
+
filename,
|
|
183
|
+
path: filePath
|
|
184
|
+
});
|
|
185
|
+
return this;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Called internally by Mailer
|
|
189
|
+
*/
|
|
190
|
+
getMessageOptions() {
|
|
191
|
+
return {
|
|
192
|
+
to: this.toAddress,
|
|
193
|
+
cc: this.ccAddresses,
|
|
194
|
+
bcc: this.bccAddresses,
|
|
195
|
+
subject: this.subjectText,
|
|
196
|
+
html: this.htmlContent,
|
|
197
|
+
text: this.textContent,
|
|
198
|
+
viewPath: this.viewPath,
|
|
199
|
+
viewData: this.viewData,
|
|
200
|
+
attachments: this.attachmentsList
|
|
201
|
+
};
|
|
202
|
+
}
|
|
233
203
|
};
|
|
234
204
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
var
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
bcc: options.bcc,
|
|
253
|
-
subject: options.subject,
|
|
254
|
-
html: options.html,
|
|
255
|
-
text: options.text,
|
|
256
|
-
attachments: options.attachments
|
|
257
|
-
});
|
|
258
|
-
}
|
|
205
|
+
//#endregion
|
|
206
|
+
//#region src/Mailer.ts
|
|
207
|
+
var Mailer = class {
|
|
208
|
+
constructor(driver, edgeRenderer) {
|
|
209
|
+
this.driver = driver;
|
|
210
|
+
this.edgeRenderer = edgeRenderer;
|
|
211
|
+
}
|
|
212
|
+
async send(mailable) {
|
|
213
|
+
await mailable.build();
|
|
214
|
+
const options = mailable.getMessageOptions();
|
|
215
|
+
if (options.viewPath && !options.html) options.html = await this.edgeRenderer(options.viewPath, options.viewData || {});
|
|
216
|
+
try {
|
|
217
|
+
return this.driver.send(options);
|
|
218
|
+
} catch (error) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
259
222
|
};
|
|
260
223
|
|
|
261
|
-
|
|
224
|
+
//#endregion
|
|
225
|
+
//#region src/Service.ts
|
|
226
|
+
/**
|
|
227
|
+
* Service class to initialize and configure the mailer service
|
|
228
|
+
*/
|
|
262
229
|
var Service = class {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
* SMTP driver factory
|
|
316
|
-
* @returns
|
|
317
|
-
*/
|
|
318
|
-
smtp: () => new SMTPDriver(mailConfig.smtp),
|
|
319
|
-
/**
|
|
320
|
-
* LOG driver factory for debugging
|
|
321
|
-
* @returns
|
|
322
|
-
*/
|
|
323
|
-
log: () => new LOGDriver(mailConfig.smtp),
|
|
324
|
-
/**
|
|
325
|
-
* Sendmail driver factory
|
|
326
|
-
* @returns
|
|
327
|
-
*/
|
|
328
|
-
sendmail: () => new SendMailDriver(mailConfig.sendmail)
|
|
329
|
-
};
|
|
330
|
-
return new Mailer((driver[config.get("mail.default")] ?? driver.smtp)(), async (viewPath, data) => await view(viewPath, data));
|
|
331
|
-
}
|
|
230
|
+
/**
|
|
231
|
+
* Initializes the mailer service with the given application instance
|
|
232
|
+
*
|
|
233
|
+
* @param app
|
|
234
|
+
* @returns
|
|
235
|
+
*/
|
|
236
|
+
static init(app) {
|
|
237
|
+
/**
|
|
238
|
+
* Resolve the view and config services from the container
|
|
239
|
+
*/
|
|
240
|
+
const view = app.make("view");
|
|
241
|
+
const config = app.make("config");
|
|
242
|
+
/**
|
|
243
|
+
* Configure mailer settings for different drivers
|
|
244
|
+
*/
|
|
245
|
+
const mailConfig = {
|
|
246
|
+
smtp: {
|
|
247
|
+
host: config.get("mail.mailers.smtp.host", "smtp.mailtrap.io"),
|
|
248
|
+
port: Number(config.get("mail.mailers.smtp.port", 2525)),
|
|
249
|
+
auth: {
|
|
250
|
+
user: config.get("mail.mailers.smtp.username", ""),
|
|
251
|
+
pass: config.get("mail.mailers.smtp.password", "")
|
|
252
|
+
},
|
|
253
|
+
opportunisticTLS: config.get("mail.mail气的mailers.smtp.encryption") === "tls",
|
|
254
|
+
connectionTimeout: config.get("mail.mailers.smtp.timeout"),
|
|
255
|
+
debug: false
|
|
256
|
+
},
|
|
257
|
+
ses: {
|
|
258
|
+
key: config.get("services.ses.key", ""),
|
|
259
|
+
token: config.get("services.ses.token", ""),
|
|
260
|
+
secret: config.get("services.ses.secret", ""),
|
|
261
|
+
region: config.get("services.ses.region", "us-east-1"),
|
|
262
|
+
maxConnections: config.get("mail.mailers.ses.connections", 10),
|
|
263
|
+
sendingRate: config.get("mail.mailers.ses.rate", 5)
|
|
264
|
+
},
|
|
265
|
+
sendmail: { path: config.get("mail.mailers.sendmail.path", "sendmail") }
|
|
266
|
+
};
|
|
267
|
+
/**
|
|
268
|
+
* Define available mail drivers
|
|
269
|
+
*/
|
|
270
|
+
const driver = {
|
|
271
|
+
ses: () => new SESDriver(mailConfig.ses),
|
|
272
|
+
smtp: () => new SMTPDriver(mailConfig.smtp),
|
|
273
|
+
log: () => new LOGDriver(mailConfig.smtp),
|
|
274
|
+
sendmail: () => new SendMailDriver(mailConfig.sendmail)
|
|
275
|
+
};
|
|
276
|
+
/**
|
|
277
|
+
* Initialize Mailer with the selected driver (default to SMTP if not specified)
|
|
278
|
+
* and a view rendering function
|
|
279
|
+
*/
|
|
280
|
+
return new Mailer((driver[config.get("mail.default")] ?? driver.smtp)(), async (viewPath, data) => await view(viewPath, data));
|
|
281
|
+
}
|
|
332
282
|
};
|
|
333
283
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
284
|
+
//#endregion
|
|
285
|
+
//#region src/Providers/MailServiceProvider.ts
|
|
286
|
+
/**
|
|
287
|
+
* Mail delivery setup.
|
|
288
|
+
*
|
|
289
|
+
* Bind Mailer service.
|
|
290
|
+
* Load mail drivers (SMTP, SES, etc.).
|
|
291
|
+
* Register Mail facade.
|
|
292
|
+
*
|
|
293
|
+
*/
|
|
294
|
+
var MailServiceProvider = class extends __h3ravel_core.ServiceProvider {
|
|
295
|
+
static priority = 990;
|
|
296
|
+
register() {
|
|
297
|
+
/**
|
|
298
|
+
* Register Mailer instance
|
|
299
|
+
*/
|
|
300
|
+
this.app.singleton(Mailer, () => {
|
|
301
|
+
return Service.init(this.app);
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
boot() {
|
|
305
|
+
/**
|
|
306
|
+
* Add logic here for global mail "from" address and others
|
|
307
|
+
*/
|
|
308
|
+
}
|
|
348
309
|
};
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
});
|
|
310
|
+
|
|
311
|
+
//#endregion
|
|
312
|
+
exports.LOGDriver = LOGDriver;
|
|
313
|
+
exports.MailServiceProvider = MailServiceProvider;
|
|
314
|
+
exports.Mailable = Mailable;
|
|
315
|
+
exports.Mailer = Mailer;
|
|
316
|
+
exports.SESDriver = SESDriver;
|
|
317
|
+
exports.SMTPDriver = SMTPDriver;
|
|
318
|
+
exports.SendMailDriver = SendMailDriver;
|
|
319
|
+
exports.Service = Service;
|
|
360
320
|
//# sourceMappingURL=index.cjs.map
|