fix sendEmail
This commit is contained in:
parent
c398484cf8
commit
064be8e2a6
@ -22,12 +22,6 @@ export async function sendEmail({ text, html, subject, recipients }: SendEmailPa
|
|||||||
Destination: { ToAddresses: recipients },
|
Destination: { ToAddresses: recipients },
|
||||||
Message: {
|
Message: {
|
||||||
Body: {
|
Body: {
|
||||||
Text: text
|
|
||||||
? {
|
|
||||||
Charset: "UTF-8",
|
|
||||||
Data: text,
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
Html: {
|
Html: {
|
||||||
Charset: "UTF-8",
|
Charset: "UTF-8",
|
||||||
Data: html,
|
Data: html,
|
||||||
@ -41,5 +35,12 @@ export async function sendEmail({ text, html, subject, recipients }: SendEmailPa
|
|||||||
Source: serverRuntimeConfig.awsSes.fromEmail,
|
Source: serverRuntimeConfig.awsSes.fromEmail,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (text) {
|
||||||
|
request.Message.Body.Text = {
|
||||||
|
Charset: "UTF-8",
|
||||||
|
Data: text,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
await ses.sendEmail(request).promise();
|
await ses.sendEmail(request).promise();
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ bodyClass: bg-gray-postmark-lighter
|
|||||||
</p>
|
</p>
|
||||||
<p class="mt-6 mb-20 text-base leading-24 text-gray-postmark-dark">
|
<p class="mt-6 mb-20 text-base leading-24 text-gray-postmark-dark">
|
||||||
My name is Mokhtar and I built {{ page.company.product }} after
|
My name is Mokhtar and I built {{ page.company.product }} after
|
||||||
growing tired of paying exorbitant charges for international
|
growing tired of paying exorbitant phone bills for international
|
||||||
communications and getting frustrated over the lack of decent
|
communications and getting frustrated over the lack of decent
|
||||||
consumer-oriented cloud phone solutions.
|
consumer-oriented cloud phone solutions.
|
||||||
</p>
|
</p>
|
||||||
@ -35,8 +35,8 @@ bodyClass: bg-gray-postmark-lighter
|
|||||||
</p>
|
</p>
|
||||||
<p class="mt-6 mb-20 text-base leading-24 text-gray-postmark-dark">
|
<p class="mt-6 mb-20 text-base leading-24 text-gray-postmark-dark">
|
||||||
Take care!
|
Take care!
|
||||||
<br />{{ page.company.sender }} <br />Founder at {{
|
<br />{{ page.company.sender }} <br />
|
||||||
page.company.product }}
|
Founder at {{ page.company.product }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
@ -20,15 +20,14 @@ export async function welcomeMailer({ to, userName }: ResetPasswordMailer) {
|
|||||||
return {
|
return {
|
||||||
async send() {
|
async send() {
|
||||||
if (process.env.NODE_ENV === "production") {
|
if (process.env.NODE_ENV === "production") {
|
||||||
await sendEmail({
|
return sendEmail({
|
||||||
recipients: [msg.to],
|
recipients: [msg.to],
|
||||||
subject: msg.subject,
|
subject: msg.subject,
|
||||||
html: msg.html,
|
html: msg.html,
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
// Preview email in the browser
|
|
||||||
return await previewEmail(msg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return previewEmail(msg);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user