{% extends "layouts/workspace_settings.html" %} {% load common_extras %} {% comment %} Connect an email sender. Same shape as telegram_connect.html — see the note there for why content_wrap is cleared and why the platform key is written once. The provider picker is three links rather than the GET form with a submit button it used to be. views_email._chosen_provider reads request.GET, so a link does the whole job: no JavaScript (which the nonce-based CSP would refuse in an onchange anyway), and the page's one primary button is spent on Connect rather than on a control that only changes which fields are visible. Every credential input below is type="password" with autocomplete="off", for the reason the Telegram page gives: these are live credentials and must not end up in the browser's saved form data. None of them is ever echoed back on a failed submit either — the view's `_echoed` names only non-secret fields. {% endcomment %} {% block title %}Connect email · DemandTrail Messaging{% endblock %} {% block content_wrap %}{% endblock %} {% block content %} {% with platform_key="email" %}
{% include "partials/_platform_icon.html" with platform=platform_key size="lg" only %}

Connect an email sender

Email is outbound only. DemandTrail Messaging sends through your own provider: your SMTP server, Resend, or Amazon SES. So the sending reputation, the domain and the bill stay yours.

{% if error %}
{{ error }}
{% endif %}

Before you start

  1. Set up SPF, DKIM and DMARC on the domain you are going to send from. All three, not one: without them a meaningful share of what you send goes to spam, and Gmail and Yahoo reject bulk mail from domains that lack them outright. Your provider publishes the exact records. The full checklist is in docs/channels/email.md.
  2. Have that provider's credentials to hand: an SMTP host and password, a Resend API key, or an AWS access key and secret.

Which provider sends the mail

Pick one and the fields below change to match.

{% csrf_token %}

Who it comes from

Its domain becomes this channel's identity, and only one workspace can claim a domain.

What this channel is called in DemandTrail Messaging. Defaults to the domain.

{% if provider == "smtp" %}

Your SMTP server

Choose "none" only for a relay on your own private network.

Stored encrypted and never shown again.

{% elif provider == "resend" %}

Resend

From the Resend dashboard. Stored encrypted and never shown again.

Optional now, required for bounce handling. Create a webhook endpoint in Resend pointing at the URL this page shows after you connect, then paste the secret it gives you.

{% else %}

Amazon SES

Stored encrypted and never shown again.

Optional, and you can add it later on the channel's page. Bounce handling stays off until it is set, and then only this topic's notifications are accepted.

The key needs ses:GetAccount, ses:SendEmail and ses:SendRawEmail, plus sns:ConfirmSubscription if you want bounce handling. See docs/channels/email.md.

{% endif %}

What happens next

We check the credentials with your provider before saving anything. Once the channel exists, its page shows the webhook URL to paste into Resend or to subscribe an SNS topic to, and a button that sends a test email to your own address.

Every email DemandTrail Messaging sends carries a List-Unsubscribe header and an unsubscribe link in the footer. That is not configurable: it is what keeps the channel compliant, and it is what the unsubscribe and suppression handling is built on.

Back to channels
{% endwith %} {% endblock %}