Botpress chatbot and 24/7 helpdesk
Send transactional email when a Botpress support flow opens a helpdesk incident.
Many support teams use Botpress for customer care outside office hours. When a user completes an incident flow (machine code, location, description), the bot must notify the helpdesk by email reliably — even at 3 a.m.
MailingCore fits as the transactional sending layer: async queue, versioned templates, verified domain, and delivery logs.
Typical flow
What the bot should do
- Validate minimum fields (contact email, incident type, description).
- Call your backend — never expose the API key in the browser widget; use a server-side Botpress action or a bridge service (e.g.
botpress-service) with env vars. - Send via
POST /emails/sendwith metadata to correlate ticket and conversation. - Confirm in chat only after a successful API response.
Send example
curl -X POST "https://api.mailingcore.com/emails/send" \
-H "Authorization: Bearer mc_live_xxxx" \
-H "Content-Type: application/json" \
-d '{
"to": "[email protected]",
"subject": "[Incident] Code 5859 — Albacenter Mall",
"htmlBody": "<h2>New chatbot incident</h2><p>Code: 5859</p><p>Location: Albacenter Mall</p><p>Contact: [email protected]</p>",
"replyTo": "[email protected]",
"fromEmail": "[email protected]",
"fromName": "Virtual assistant",
"tags": ["botpress", "helpdesk", "incident"],
"metadata": {
"source": "botpress",
"conversationId": "conv_abc123",
"incidentCode": "5859",
"locale": "en"
},
"idempotencyKey": "botpress-conv_abc123-incident"
}'
| Field | Helpdesk use |
|---|---|
metadata.conversationId | Link to Botpress thread / operator inbox |
metadata.incidentCode | Machine or internal reference code |
replyTo | Reply directly to the customer |
idempotencyKey | Prevent duplicates on user retry |
tags | Filter in send logs |
Optional: publish a template in the dashboard and send with templateVersionId instead of inline htmlBody.
User-facing confirmation
After sending, the bot typically shows a closing message such as:
Your incident has been registered successfully. Our technical team will contact you within 24 business hours.
That text is chat UX only; the helpdesk email carries operational detail. If you run a conversation inbox (Botpress sync + send detection), you can set email_sent_detected when the bot confirms registration.
Operational requirements
| Requirement | Detail |
|---|---|
| API key | Minimum scope email:send |
| Domain | Verify sender (fromEmail) |
| Quota | Each incident counts toward monthly quota — watch X-Quota-* |
| Availability | BullMQ queue accepts requests 24/7; no self-hosted SMTP required |
Common errors
- 401 / 403 — Revoked key or missing scope; see API keys.
- 429 — Quota exceeded; plans and upgrade.
- Duplicates — Missing
idempotencyKeyper conversation. - Key in client — Move the call server-side; see API key security.
Next steps
- Quick start
- Send with the SDK — if the bridge is Node.js
- Webhooks — notify your CRM on
email.sentoremail.bounced