Send email
Configure an automated email action that fires when a visitor completes a specific step in your chatbot flow.
How it works
The send email action fires a request to an external webhook endpoint that you control, which then sends the email using your own email provider (SendGrid, Mailgun, AWS SES, or any SMTP). DGbot does not send email directly — it calls your webhook with the data, and your endpoint sends the email.
This keeps email sending under your control and lets you use your existing email infrastructure and templates.
Configure the email action
Go to Settings → Integrations → Custom API actions.
Open Custom API actions in adminThe Custom API actions configuration panel. Add a new action and configure the webhook.
Click Add action and name it (e.g., "Send results email"). Set the action type to Email notification.
Paste the URL of your webhook endpoint. DGbot will POST to this URL when the action fires.
Define the JSON body DGbot sends to your webhook. Use template variables (see below) to include conversation data:
{
"to_email": "{{user_email}}",
"to_name": "{{user_name}}",
"conversation_id": "{{conversation_id}}",
"subject": "Your inquiry from {{chatbot_name}}",
"results_url": "{{results_url}}"
}If your webhook endpoint requires authentication, add headers:
| Header | Example value |
|---|---|
Authorization | Bearer your-webhook-secret |
X-API-Key | your-api-key |
Choose the trigger:
- On lead capture — fires immediately after the lead form is submitted
- On specific message — fires when the visitor sends a message matching a keyword or pattern
- On escalation — fires when the visitor requests a human agent
- Manual — a button appears in the chat that the visitor clicks to trigger the action
Template variables
Use these variables in your webhook body template:
| Variable | Value |
|---|---|
{{user_email}} | Visitor's email (requires lead capture) |
{{user_name}} | Visitor's name (requires lead capture) |
{{conversation_id}} | Unique ID for the conversation |
{{request_id}} | Unique ID for this action call |
{{chatbot_name}} | Your bot's display name |
{{chatbot_id}} | Your chatbot's unique identifier |
{{timestamp}} | ISO 8601 timestamp when the action fired |
Test the action
Open the Preview panel and simulate the trigger condition (e.g., submit the lead form if the trigger is on lead capture).
Open Preview in adminVerify your webhook endpoint received the POST request. Use a tool like Request Bin or your provider's webhook log to inspect the payload.
Check that your email provider sent the email and it arrived in the expected inbox. Check spam folders if it doesn't appear in the inbox.