Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

Commit

Permalink
Add merchant name to email "from" address for shipment and login emails
Browse files Browse the repository at this point in the history
  • Loading branch information
robbieaverill committed Nov 1, 2021
1 parent ab794ad commit baba1e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@ module.exports = async function handler(request, context) {
case 'orders.physical.shipment':
await sendGridMail.send({
to: data.payload.customer.email,
from: data.merchant.support_email, // must be verified in SendGrid before it can be used
from: {
email: data.merchant.support_email, // must be verified in SendGrid before it can be used
name: data.merchant.name,
},
subject: 'Your order has a new shipment!',
dynamic_template_data: data,
template_id: getTemplateId(data.event, integration),
Expand All @@ -179,7 +182,10 @@ module.exports = async function handler(request, context) {
case 'customers.login.token':
await sendGridMail.send({
to: data.payload.email,
from: data.merchant.support_email, // must be verified in SendGrid before it can be used
from: {
email: data.merchant.support_email, // must be verified in SendGrid before it can be used
name: data.merchant.name,
},
subject: 'Log in to your account',
dynamic_template_data: data,
template_id: getTemplateId(data.event, integration),
Expand Down

0 comments on commit baba1e5

Please sign in to comment.