Skip to content
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

Feature request: Mailtrap #345

Open
eriktelepovsky opened this issue Dec 14, 2023 · 4 comments
Open

Feature request: Mailtrap #345

eriktelepovsky opened this issue Dec 14, 2023 · 4 comments
Labels

Comments

@eriktelepovsky
Copy link

Hello. Do you plan to add Mailtrap as a supported ESP?

https://mailtrap.io/

@medmunds
Copy link
Contributor

medmunds commented Dec 20, 2023

Mailtrap looks like a good fit for Anymail: it has a transactional sending API and a free plan that would cover Anymail's weekly integration testing.

Others who are interested, please express support by adding a thumbs up reaction to the first comment in this issue.

Note that you should already be able to send messages with Mailtrap from your Django app: just configure Django's SMTP EmailBackend to use Mailtrap's SMTP service.

PR welcome. (Or I'll get to this at some point, but it's not likely to be in the next few months.)

For mapping Mailtrap to Anymail features: it looks like Mailtrap provides status tracking webhooks, metadata ("custom variables"), a single tag ("category"), and ESP-stored templates (though their API docs don't currently cover sending with a template Edit: docs for sending "EmailWithTemplate" are hidden behind a popup labelled "EmailWithText (one of)").

Mailtrap doesn't currently seem to offer inbound email support, deferred sending, or the ability to control open and click tracking on individual messages.

@rez0n
Copy link

rez0n commented Jan 18, 2024

Hi @medmunds
It also would be awesome to support Mailtrap "Email Testing" (mailtrap initially is mail testing suite, and recently launched an "Email Sending" service)
For example, on production I using AWS SES, but for development and staging purposes I use Mailtrap as mail catch-all/testing service.

@medmunds
Copy link
Contributor

Hey @rez0n, if I'm understanding correctly, Mailtrap's email testing feature provides a fake SMTP server that captures sent emails. So you'd just supply those SMTP credentials to Django's built-in SMTP EmailBackend (links in the earlier comment)—there's not really a need for an Anymail backend for that.

It looks like Mailtrap has recently introduced an "early access" HTTP API for sending to test mailboxes, and that could be supported by an Anymail backend. Their docs note it's likely to change, but currently the test API matches Mailtrap's regular email send API payload, except it doesn't support templates. It should be relatively easy to add support for this in Anymail at the same time as regular sending. [If anyone from Mailtrap sees this comment, it would be even easier if the test inbox id could be an API payload field, rather than part of the API endpoint url.]

@rez0n
Copy link

rez0n commented Jan 31, 2024

Hi @medmunds

if I'm understanding correctly, Mailtrap's email testing feature provides a fake SMTP server that captures sent emails. So you'd just supply those SMTP credentials to Django's built-in SMTP EmailBackend (links in the earlier comment)—there's not really a need for an Anymail backend for that.

This is literally what I do.

It looks like Mailtrap has recently introduced an "early access" HTTP API for sending to test mailboxes, and that could be supported by an Anymail backend. Their docs note it's likely to change, but currently the test API matches Mailtrap's regular email send API payload, except it doesn't support templates. It should be relatively easy to add support for this in Anymail at the same time as regular sending. [If anyone from Mailtrap sees this comment, it would be even easier if the test inbox id could be an API payload field, rather than part of the API endpoint url.]

Sounds very good because in current setup I have different logic of emailing backend on dev(mailtrap via SMTP) and prod (SES via anymail) which is not cool in my opinion.

Thank you for this awesome project, looking forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants