@arkstack/notifications 0.17.20 → 0.17.21
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/index.d.ts +14 -0
- package/dist/index.js +18 -0
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { Logger } from "nodemailer/lib/shared/index.js";
|
|
|
5
5
|
import MailMessage from "nodemailer/lib/mailer/mail-message.js";
|
|
6
6
|
import { User } from "@app/models/User";
|
|
7
7
|
import { User as User$1 } from "@arkstack/auth";
|
|
8
|
+
import { Attachment } from "nodemailer/lib/mailer/index.js";
|
|
8
9
|
import { PhoneNumber } from "@kanun-hq/plugin-phone";
|
|
9
10
|
import { ArkormCollection, LengthAwarePaginator } from "arkormx";
|
|
10
11
|
//#region src/Contracts/UserNotification.d.ts
|
|
@@ -299,6 +300,7 @@ declare class MailNotification extends NotificationContract {
|
|
|
299
300
|
private htmlTemplate?;
|
|
300
301
|
private textTemplate?;
|
|
301
302
|
private fileDirectory?;
|
|
303
|
+
private attachmentList?;
|
|
302
304
|
constructor(options?: MailNotificationOptions);
|
|
303
305
|
/**
|
|
304
306
|
* Prepare the mail driver so we can use it to relay the message
|
|
@@ -312,6 +314,18 @@ declare class MailNotification extends NotificationContract {
|
|
|
312
314
|
* @returns
|
|
313
315
|
*/
|
|
314
316
|
subject(subject: string): this;
|
|
317
|
+
/**
|
|
318
|
+
* Attachemnts to send with the mail
|
|
319
|
+
*
|
|
320
|
+
* @param attachments
|
|
321
|
+
*/
|
|
322
|
+
attachments(attachments: Attachment[]): void;
|
|
323
|
+
/**
|
|
324
|
+
* A single attachemnt to send with the mail
|
|
325
|
+
*
|
|
326
|
+
* @param attachment
|
|
327
|
+
*/
|
|
328
|
+
attachment(attachment: Attachment): void;
|
|
315
329
|
/**
|
|
316
330
|
* Set email the notification recipeint
|
|
317
331
|
*
|
package/dist/index.js
CHANGED
|
@@ -212,6 +212,7 @@ var MailNotification = class extends NotificationContract {
|
|
|
212
212
|
htmlTemplate;
|
|
213
213
|
textTemplate;
|
|
214
214
|
fileDirectory;
|
|
215
|
+
attachmentList;
|
|
215
216
|
constructor(options = {}) {
|
|
216
217
|
super();
|
|
217
218
|
this.driverConfig = configure("drivers.mail", {});
|
|
@@ -305,6 +306,22 @@ var MailNotification = class extends NotificationContract {
|
|
|
305
306
|
return this;
|
|
306
307
|
}
|
|
307
308
|
/**
|
|
309
|
+
* Attachemnts to send with the mail
|
|
310
|
+
*
|
|
311
|
+
* @param attachments
|
|
312
|
+
*/
|
|
313
|
+
attachments(attachments) {
|
|
314
|
+
this.attachmentList = attachments;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* A single attachemnt to send with the mail
|
|
318
|
+
*
|
|
319
|
+
* @param attachment
|
|
320
|
+
*/
|
|
321
|
+
attachment(attachment) {
|
|
322
|
+
this.attachmentList = [...this.attachmentList ?? [], attachment];
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
308
325
|
* Set email the notification recipeint
|
|
309
326
|
*
|
|
310
327
|
* @param recipient string or array of email addresses
|
|
@@ -391,6 +408,7 @@ var MailNotification = class extends NotificationContract {
|
|
|
391
408
|
html: this.htmlTemplate ? interpolate(this.htmlTemplate, templateData) : await globalThis.view(this.ViewName, templateData)
|
|
392
409
|
};
|
|
393
410
|
if (this.transport === "ses") payload.ses = this.sesOptions;
|
|
411
|
+
if (this.attachmentList) payload.attachments = this.attachmentList;
|
|
394
412
|
const result = await this.driver.sendMail(payload);
|
|
395
413
|
if (this.fileDirectory) await this.storeFileMail(payload, result);
|
|
396
414
|
return result;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkstack/notifications",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.21",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Framework-agnostic notification module for Arkstack and Nodejs, providing support for multi-channel notification delivery.",
|
|
6
6
|
"homepage": "https://arkstack.toneflix.net/guide/notifications",
|
|
@@ -34,16 +34,16 @@
|
|
|
34
34
|
"africastalking": "^0.8.0",
|
|
35
35
|
"nodemailer": "^9.0.3",
|
|
36
36
|
"twilio": "^6.0.2",
|
|
37
|
-
"@arkstack/common": "^0.17.
|
|
37
|
+
"@arkstack/common": "^0.17.21"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@kanun-hq/plugin-phone": "^0.1.8",
|
|
41
41
|
"firebase-admin": "^13.0.0",
|
|
42
42
|
"pusher": "^5.2.0",
|
|
43
|
-
"@arkstack/contract": "^0.17.
|
|
44
|
-
"@arkstack/database": "^0.17.
|
|
45
|
-
"@arkstack/driver-
|
|
46
|
-
"@arkstack/driver-
|
|
43
|
+
"@arkstack/contract": "^0.17.21",
|
|
44
|
+
"@arkstack/database": "^0.17.21",
|
|
45
|
+
"@arkstack/driver-h3": "^0.17.21",
|
|
46
|
+
"@arkstack/driver-express": "^0.17.21"
|
|
47
47
|
},
|
|
48
48
|
"peerDependenciesMeta": {
|
|
49
49
|
"@arkstack/driver-express": {
|