Skip to content

Commit

Permalink
Starts storing webhook data for SES (#155)
Browse files Browse the repository at this point in the history
* Starts storing webhook data for SES

* Makes extra optional
  • Loading branch information
pushchris authored May 9, 2023
1 parent b2d8a13 commit ca7fca1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/platform/src/providers/email/SESEmailProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,6 @@ export default class SESEmailProvider extends EmailProvider {
const campaign = await getCampaign(campaignId, projectId)

const interaction = notificationType === 'Bounce' ? 'bounced' : 'complained'
await trackLinkEvent({ user, campaign }, interaction)
await trackLinkEvent({ user, campaign }, interaction, json)
}
}
2 changes: 2 additions & 0 deletions apps/platform/src/render/LinkService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export const injectInBody = (html: string, injection: string, placement: 'start'
export const trackLinkEvent = async (
parts: Partial<TrackedLinkExport>,
interaction: 'opened' | 'clicked' | 'bounced' | 'complained',
extra?: any,
) => {
const { user, campaign } = parts
if (!user || !campaign) return
Expand All @@ -124,6 +125,7 @@ export const trackLinkEvent = async (
channel: campaign.channel,
url: parts.redirect,
subscription_id: campaign.subscription_id,
extra,
},
},
})
Expand Down

0 comments on commit ca7fca1

Please sign in to comment.