feat: disable tracking in transactional email #2241
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
AWS SES includes a 1x1 tracking pixel to detect whether or not a user has opened/read an email. GSIBs block this tracking pixel which causes it to appear as a little red X at the bottom of emails. This makes the emails appear suspicious.
In this PR, I add a feature to enable transactional email users to turn off this tracking feature via a new
disable_tracking
flag. This would prevent this issue from popping up.Solution
The events that are tracked by SES is determined by the configuration set that SES uses when sending out the email. This configuration set is determined by the value of the
X-SES-CONFIGURATION-SET
header. Configuration sets are defined via the AWS console.I've added an additional configuration set (
postman-email-no-tracking
) toap-southeast-2
that does not include trackingOpen
andRead
states. This prevents the gif from being added.Additionally, the transactional email request body now includes an optional
disable_tracking
field that users can set totrue
if they don't want the tracking pixel to be added. When tracking is disabled, we will use thepostman-email-no-tracking
configuration set instead of the defaultpostman-email-open
configuration set.Deployment Notes
New Env Vars
BACKEND_SES_NO_TRACKING_CONFIGURATION_SET
:Name of SES configuration set that does not include tracking open/read events