biz-email-builder-shared 1.6.6 → 1.6.7
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.
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
export declare function sendMailViaGmail(
|
|
1
|
+
export declare function sendMailViaGmail(recipient: {
|
|
2
|
+
to: string[];
|
|
3
|
+
bcc?: string[];
|
|
4
|
+
cc?: string[];
|
|
5
|
+
}, subject: string, text: string, attachments: [{
|
|
2
6
|
filename: string;
|
|
3
7
|
path?: string;
|
|
4
8
|
content?: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendMailViaGmail.d.ts","sourceRoot":"","sources":["../../src/utilities/sendMailViaGmail.ts"],"names":[],"mappings":"AAEA,wBAAsB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"sendMailViaGmail.d.ts","sourceRoot":"","sources":["../../src/utilities/sendMailViaGmail.ts"],"names":[],"mappings":"AAEA,wBAAsB,gBAAgB,CAAC,SAAS,EAAE;IAChD,EAAE,EAAE,MAAM,EAAE,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,EAAE,CAAA;CACd,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,GAAG,CAAA;CAAE,CAAC,EAAE,MAAM,EAAE,OAAO,sBAsCnH"}
|
|
@@ -5,7 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.sendMailViaGmail = sendMailViaGmail;
|
|
7
7
|
const nodemailer_1 = __importDefault(require("nodemailer"));
|
|
8
|
-
async function sendMailViaGmail(
|
|
8
|
+
async function sendMailViaGmail(recipient, subject, text, attachments, isHtml) {
|
|
9
|
+
const { to = [], bcc = [], cc = [] } = recipient;
|
|
9
10
|
// Create a Nodemailer transporter using AWS SES SMTP credentials
|
|
10
11
|
const transporter = nodemailer_1.default.createTransport({
|
|
11
12
|
service: "gmail", // SES SMTP endpoint for your region
|
|
@@ -20,7 +21,8 @@ async function sendMailViaGmail(to = [], bcc = [], subject, text, attachments, i
|
|
|
20
21
|
to, // recipient email address
|
|
21
22
|
subject, // subject of the email
|
|
22
23
|
attachments: attachments || [],
|
|
23
|
-
bcc
|
|
24
|
+
bcc,
|
|
25
|
+
cc
|
|
24
26
|
};
|
|
25
27
|
text = text.replace("${username}", process.env.GMAIL_FROM_USERNAME || "");
|
|
26
28
|
if (isHtml) {
|