Skip to content

Commit

Permalink
fix: remove email unsub link when unsubcribe tag not present
Browse files Browse the repository at this point in the history
  • Loading branch information
CesarAyuso committed Jul 18, 2024
1 parent c9ecf66 commit fddd802
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,16 @@ export class SendEmailPerformer extends MessageSendPerformer<Settings, Payload>
return $.html()
}

if ($(unsubscribeLinkRef).length === 0) {
_this.logger.info(`Unsubscribe tag is missing`)
emailProfile.unsubscribeLink = ''
}

if ($(preferencesLinkRef).length === 0) {
_this.logger.info(`Preferences tag missing`)
emailProfile.preferencesLink = ''
}

if (groupId) {
const group = emailProfile.groups?.find((grp) => grp.id === groupId)
const groupUnsubscribeLink = group?.groupUnsubscribeLink
Expand Down

0 comments on commit fddd802

Please sign in to comment.