Overview
The Email Sending Integration lets your agent send emails to one or many recipients with minimal setup. It works with the built‑in ai12z provider or any SMTP service (e.g., Gmail, Outlook). You can use it two ways: (1) have the LLM supply a complete HTML body, or (2) use an HTML template for consistent styling while the LLM sends only the context variables the template renders (mustache‑style).
Quick start
- Enable Send Email and open settings, test, or templates

- Choose your provider

- If Custom, enter SMTP settings and Save

- Send a quick test

Use the link icon next to Send Email to manage templates.
Key Features
- Multiple Recipients: Send emails to one or more recipients in a single operation.
- HTML Email Support: Compose rich emails using HTML for better formatting and presentation.
- Template-Based Emails: Use pre-configured HTML templates with dynamic content rendering.
- Barcode & QR Code Generation: Automatically generate barcodes and QR codes within email templates.
- Flexible Variable Naming: Support for both clean variable names and form fields with spaces.
- Custom Email Providers: Configure and use your own email providers, including popular services like Gmail and Outlook.
- Easy Integration: As an out-of-the-box Integration, it requires no customization except connecting to your email service
Purpose
The Integration is designed to:
- Enhance Communication: Enable your Agent to send notifications, alerts, newsletters, or any email communication to users.
- Simplify Integration: Eliminate the need for complex SMTP configurations and email handling code.
- Save Time: Automate the process of sending emails, allowing you to focus on your Agent features.
How it works
- The agent calls the integration with recipients, subject, and either direct HTML or a template name plus context.
- The integration renders variables (and barcode/QR if provided) and sends using the configured provider.
Email Provider Configuration
Using ai12z as Email Provider
By default, the Integration uses the ai12z email provider, which requires minimal setup. For production, configure your own provider to ensure deliverability and compliance.
Configuring a Custom Email Provider
You should use your own email provider, (e.g., Gmail, Outlook, or a custom SMTP server), as the ai12z is used for prototyping your application. Follow these steps:
-
Access Email Settings:
- Navigate to your ai12z Copilot portal.
- Go to Agent Settings.
- Select the Email tab to configure your email provider.
-
Fields to Configure:

- Email Provider: Choose
Customor select a pre-configured provider if available. - Server: Enter your SMTP server address.
- Gmail:
smtp.gmail.com - Outlook:
smtp.office365.com - Custom Server: Your SMTP server domain (e.g.,
smtp.yourdomain.com)
- Gmail:
- fromEmail: Specify the email address you want to send emails from.
- Port: Enter the SMTP port number.
- Common ports:
587for TLS465for SSL25for non-encrypted connections
- Common ports:
- Use Secure Connection: Check this box if your provider requires a secure connection (TLS/SSL).
- UserName: Your email account username (typically your email address).
- Password: The password for your email account.
-
Save your settings
- Click Save to apply your settings.
- Ensure your credentials and server details are correct to enable successful email sending.
-
Send a test email
- Send a test email to verify that the settings work correctly.
- Navigate to the test email section under the email settings or trigger an action that sends an email.

Example Configurations
Gmail Setup:
- Server:
smtp.gmail.com - Port:
587 - Use Secure Connection: Checked (TLS)
- UserName: Your Gmail email address (e.g.,
youremail@gmail.com) - Password: Your Gmail password (consider using an app-specific password if 2-step verification is enabled)
Outlook Setup:
- Server:
smtp.office365.com - Port:
587 - Use Secure Connection: Checked (TLS)
- UserName: Your Outlook email address (e.g.,
youremail@outlook.com) - Password: Your Outlook password
Custom Server Setup:
- Server: Your custom SMTP server (e.g.,
smtp.yourdomain.com) - Port: Based on your server settings (usually
587or465) - Use Secure Connection: Depends on your server configuration
- UserName: Your email address or username
- Password: Your email account password
Parameters
When the LLM invoking the Email Sending Integration, it can specify the following parameters:
-
recipients (array of strings, required): A list of email addresses to send the email to. For example:
["user1@example.com", "user2@example.com"]. -
subject (string, required): The subject line of the email.
-
body_html (string, optional): The HTML content of the email body when sending direct HTML. Allows for rich text formatting and inclusion of images, links, and other HTML elements.
-
templateName (string, optional): The name of the HTML template to use for rendering the email. Use this when using templates stored in your ai12z configuration.
-
context (object, optional): A dictionary of data to fill into the template when using templateName. Contains variables like firstName, lastName, phone, etc. Special variables for barcode/QR generation:
barcode_number: Will automatically generate a barcode image accessible as{{ barcode_img }}qrcode_text: Will automatically generate a QR code image accessible as{{ qrcode_img }}
Important: Use EITHER body_html (for direct HTML content) OR templateName with context (for template-based emails). If no templateName or context is available in the system, you MUST use body_html with direct HTML content.
Template Rendering and Best Practices
Flexible Template System
The ai12z Email Integration supports flexible template rendering that adapts to different variable naming conventions (snake_case or names with spaces).
Manage templates from the link icon next to Send Email.

Create or edit an HTML template and save.

Preview the template to validate variables and layout.
