Skip to content

docs (email): update e2e email local testing docs #5760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion docs/end-to-end-local-email-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ AWS needs to verify you own the domain before it will send its email to you.
2. Go to your domain's DNS and add the new CNAME records with the values that
SES generated for you.

#### Verify emails

If you are using the AWS free trial, you will need to verify any emails you are using. SES in the AWS free tier will only send to verified emails, if you "Request production access" in the dashboard you don't need to do this. Otherwise, verifying the following emails for local testing:

- `[email protected]`
- `[email protected]`
- `[email protected]` (only if you need to do testing with replies)

Comment on lines +65 to +72
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: nice!

#### (Suggested) Use ngrok to make your local server available
When SES sends email thru an SNS HTTPS subscription, it is helpful to have a
permanent public domain that proxies your local server. [ngrok](ngrok) is a
Expand Down Expand Up @@ -123,7 +131,18 @@ right domain. So, you'll need to set some environment variable values:
* `MOZMAIL_DOMAIN=yourdomain.com`
* `[email protected]`

Note again: These are NOT your ngrok.io domain.
Note again: These are NOT your ngrok.io domain. Any user that wishes to reply will need to have their email verified in the free tier of SES (see the "Verify Emails" section above)

One challenge with making both of these domains the same is that the reply logic assumes there are two different domains. In order to test replies in a local environment, you have two options:

1. Set up an additional domain for the `replies` email address that is configured for SES reply handling (follow same steps as above)
2. Alter the following line in `emails/views.py`:

`domain_numerical = get_domain_numerical(domain)` can be replaced with:

`domain_numerical = get_domain_numerical(domain) if local_address != 'example_mask_address' else 2`.

This will allow replies that are sent to `[email protected]` to be properly forwarded to the user that owns the mask.
Comment on lines +136 to +145
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: thanks for adding this!

suggestion (non-blocking): File a tech debt ticket to refactor the reply logic to no longer assume there are two different domains?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


### Set up your AWS SES to send emails FROM your app
The last part of Relay is sending emails FROM the Relay app to the real email
Expand Down