Email (SMTP)¶
Audience: Everyone / Admins · Tags:
smtp,connector
Send a plain-text email as a flow action. connectorKey is email, action
type send_email, authType is custom — there's no per-user OAuth. Instead,
an administrator configures one SMTP account for the whole SnapLink server,
and every workspace's Email action sends through it.
Fields¶
| Field | Required | Type | Notes |
|---|---|---|---|
to |
Yes | string | Must look like a valid email address (name@domain.tld). |
subject |
No | string | Defaults to a generic subject if left blank. |
text |
Yes | string | The plain-text body. |
Output: a messageId from the mail server, plus the to address.
The message you write is sent exactly as written each time — SnapLink doesn't yet insert data from the incoming webhook into it.
Setting up SMTP (administrator)¶
This is server configuration, not something an end user sets from the flow editor. Set these environment variables on the SnapLink server:
SMTP_HOST, SMTP_PORT (587 or 465), SMTP_USER, SMTP_PASS, SMTP_FROM.
Pick one of these free/inexpensive providers:
Gmail¶
- Turn on 2-Step Verification on the Google account you'll send from: Google Account → Security → 2-Step Verification.
- Go to Security → App Passwords, create one for "Mail", and copy it. A normal Gmail password will not work here.
- Set:
SMTP_HOST=smtp.gmail.com SMTP_PORT=465 SMTP_USER=you@gmail.com SMTP_PASS=<the 16-character app password> SMTP_FROM=you@gmail.com
Brevo¶
- Create a free Brevo account (free tier: roughly 300 emails/day).
- Under SMTP & API settings, copy your SMTP login and generate an SMTP key.
- Set:
SMTP_HOST=smtp-relay.brevo.com SMTP_PORT=587 SMTP_USER=<your Brevo SMTP login> SMTP_PASS=<your Brevo SMTP key> SMTP_FROM=you@yourdomain.com
Mailtrap (testing only — doesn't send real email)¶
- Create a free Mailtrap account and open a Sandbox inbox.
- Copy the SMTP credentials shown for that inbox.
- Set:
Every email lands in your private Mailtrap inbox instead of a real recipient — use this while building a flow so you don't spam anyone.
SMTP_HOST=sandbox.smtp.mailtrap.io SMTP_PORT=587 SMTP_USER=<inbox username> SMTP_PASS=<inbox password> SMTP_FROM=test@example.com
Without SMTP configured¶
If SMTP_HOST/SMTP_USER/SMTP_PASS/SMTP_FROM aren't all set, every send
fails with error code auth and a plain message that SMTP isn't configured.
This is an operator configuration issue, not something you can fix from
the flow editor — ask your administrator to set the environment variables
above.
Worked example¶
Flow: webhook trigger → Email action
{
"trigger": { "key": "t", "connectorKey": "webhook", "triggerType": "webhook" },
"actions": [
{
"key": "a1",
"connectorKey": "email",
"actionType": "send_email",
"input": {
"to": "sales@example.com",
"subject": "New lead received",
"text": "A new lead came in through the webhook. Check the CRM."
}
}
]
}
1. Create the flow and draft:
curl -X POST "https://api.snaplink.cloudsolutionaccelerators.com/api/v1/flows/flow_abc123/drafts" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"definition": { "trigger": {"key":"t","connectorKey":"webhook","triggerType":"webhook"}, "actions": [{"key":"a1","connectorKey":"email","actionType":"send_email","input":{"to":"sales@example.com","subject":"New lead received","text":"A new lead came in through the webhook. Check the CRM."}}] }}'
2. Promote it to activate:
curl -X POST "https://api.snaplink.cloudsolutionaccelerators.com/api/v1/drafts/draft_xyz/promote" \
-H "Authorization: Bearer $TOKEN"
3. Trigger it (see webhook.md for getting the URL):
curl -X POST "https://api.snaplink.cloudsolutionaccelerators.com/api/v1/webhooks/flow_abc123/<secret>" \
-H "Content-Type: application/json" -d '{}'
{ "ok": true, "data": { "runId": "run_01HF...", "status": "queued" } }
4. Check the run in Execution History. If
SMTP is configured, sales@example.com receives the email; the step's output
shows a messageId.
Limitations¶
- Plain text only — no HTML formatting or attachments today.
- One shared SMTP account per SnapLink deployment; there's no per-workspace SMTP configuration yet.
- Deliverability (spam filtering, sending reputation) depends entirely on your SMTP provider — SnapLink doesn't manage domain authentication (SPF/DKIM) for you.
If something goes wrong¶
| Symptom | Cause | Fix |
|---|---|---|
Run fails auth |
SMTP not configured on the server | Ask your admin to set the SMTP_* variables above |
Run fails bad_request |
to isn't a valid-looking email address |
Fix the to field |
| Run succeeds but no email arrives | Provider blocked or spam-filtered it | Check your SMTP provider's dashboard/logs |
See Connector failed for the general failure-diagnosis path.
Related: Webhook trigger · Connector Catalog · Authentication errors