Fix error when adding attachments (#82)
This commit is contained in:
@@ -204,9 +204,9 @@ export async function sendEmailWithAttachments({
|
|||||||
const boundary = "NextPart";
|
const boundary = "NextPart";
|
||||||
let rawEmail = `From: ${from}\n`;
|
let rawEmail = `From: ${from}\n`;
|
||||||
rawEmail += `To: ${Array.isArray(to) ? to.join(", ") : to}\n`;
|
rawEmail += `To: ${Array.isArray(to) ? to.join(", ") : to}\n`;
|
||||||
rawEmail += `Cc: ${cc ? cc.join(", ") : ""}\n`;
|
rawEmail += cc && cc.length ? `Cc: ${cc.join(", ")}\n` : "";
|
||||||
rawEmail += `Bcc: ${bcc ? bcc.join(", ") : ""}\n`;
|
rawEmail += bcc && bcc.length ? `Bcc: ${bcc.join(", ")}\n` : "";
|
||||||
rawEmail += `Reply-To: ${replyTo}\n`;
|
rawEmail += replyTo && replyTo.length ? `Reply-To: ${replyTo.join(", ")}\n` : "";
|
||||||
rawEmail += `Subject: ${subject}\n`;
|
rawEmail += `Subject: ${subject}\n`;
|
||||||
rawEmail += `MIME-Version: 1.0\n`;
|
rawEmail += `MIME-Version: 1.0\n`;
|
||||||
rawEmail += `Content-Type: multipart/mixed; boundary="${boundary}"\n\n`;
|
rawEmail += `Content-Type: multipart/mixed; boundary="${boundary}"\n\n`;
|
||||||
@@ -256,7 +256,7 @@ export async function addWebhookConfiguration(
|
|||||||
configName: string,
|
configName: string,
|
||||||
topicArn: string,
|
topicArn: string,
|
||||||
eventTypes: EventType[],
|
eventTypes: EventType[],
|
||||||
region: string
|
region: string,
|
||||||
) {
|
) {
|
||||||
const sesClient = getSesClient(region);
|
const sesClient = getSesClient(region);
|
||||||
|
|
||||||
|
@@ -220,6 +220,9 @@ async function executeEmail(
|
|||||||
to: email.to,
|
to: email.to,
|
||||||
from: email.from,
|
from: email.from,
|
||||||
subject: email.subject,
|
subject: email.subject,
|
||||||
|
replyTo: email.replyTo ?? undefined,
|
||||||
|
bcc: email.bcc,
|
||||||
|
cc: email.cc,
|
||||||
text,
|
text,
|
||||||
html: email.html ?? undefined,
|
html: email.html ?? undefined,
|
||||||
region: domain?.region ?? env.AWS_DEFAULT_REGION,
|
region: domain?.region ?? env.AWS_DEFAULT_REGION,
|
||||||
|
Reference in New Issue
Block a user