Skip to content

Commit

Permalink
add merge tags (#1563)
Browse files Browse the repository at this point in the history
Co-authored-by: David Anusontarangkul <[email protected]>
  • Loading branch information
anusontarangkul and David Anusontarangkul authored Sep 12, 2023
1 parent f332e2e commit 14423c3
Showing 1 changed file with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,18 @@ export class SendEmailPerformer extends MessageSendPerformer<Settings, Payload>
}

const bcc = JSON.parse(this.payload.bcc ?? '[]')
const [parsedSubject, apiLookupData] = await Promise.all([
const [
parsedFromEmail,
parsedFromName,
parsedFromReplyToEmail,
parsedFromReplyToName,
parsedSubject,
apiLookupData
] = await Promise.all([
this.parseTemplating(this.payload.fromEmail, { profile }, 'FromEmail'),
this.parseTemplating(this.payload.fromName, { profile }, 'FromName'),
this.parseTemplating(this.payload.replyToEmail, { profile }, 'ReplyToEmail'),
this.parseTemplating(this.payload.replyToName, { profile }, 'ReplyToName'),
this.parseTemplating(this.payload.subject, { profile }, 'Subject'),
this.performApiLookups(this.payload.apiLookups, profile)
])
Expand All @@ -145,12 +156,12 @@ export class SendEmailPerformer extends MessageSendPerformer<Settings, Payload>
}
],
from: {
email: this.payload.fromEmail,
name: this.payload.fromName
email: parsedFromEmail,
name: parsedFromName
},
reply_to: {
email: this.payload.replyToEmail,
name: this.payload.replyToName
email: parsedFromReplyToEmail,
name: parsedFromReplyToName
},
subject: parsedSubject,
content: [
Expand Down

0 comments on commit 14423c3

Please sign in to comment.