Send email

Configure an automated email action that fires when a visitor completes a specific step in your chatbot flow.

~15 minutes Starter

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

1
Open Settings → Integrations → Custom API actions

Go to Settings → Integrations → Custom API actions.

Open Custom API actions in admin
tools/email-action-settings Screenshot needed — save as: _assets/images/tools/email-action-settings.png

The Custom API actions configuration panel. Add a new action and configure the webhook.

2
Create a new action

Click Add action and name it (e.g., "Send results email"). Set the action type to Email notification.

3
Enter your webhook endpoint URL

Paste the URL of your webhook endpoint. DGbot will POST to this URL when the action fires.

Webhook endpoint must be HTTPS
Plaintext HTTP endpoints are not accepted. Your endpoint must use HTTPS.
4
Configure the request body template

Define the JSON body DGbot sends to your webhook. Use template variables (see below) to include conversation data:

json
{
  "to_email": "{{user_email}}",
  "to_name": "{{user_name}}",
  "conversation_id": "{{conversation_id}}",
  "subject": "Your inquiry from {{chatbot_name}}",
  "results_url": "{{results_url}}"
}
5
Set authentication headers (optional)

If your webhook endpoint requires authentication, add headers:

HeaderExample value
AuthorizationBearer your-webhook-secret
X-API-Keyyour-api-key
6
Configure when the action fires

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:

VariableValue
{{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

1
Open the Preview and trigger 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 admin
2
Check your webhook received the request

Verify your webhook endpoint received the POST request. Use a tool like Request Bin or your provider's webhook log to inspect the payload.

3
Verify the email was sent

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.

Rate limiting
The send email action is rate-limited to 3 calls per 10 minutes per conversation to prevent abuse. If a conversation triggers the action more than 3 times, subsequent calls are silently dropped.