This article explains how to create a Custom Tool in Frontline that sends automated emails through an external email API — in this example, using Resend. You can use it to send internal notifications, customer follow-ups, or confirmation messages triggered by your AI Agent.
⚙️ What you’ll need
Before creating the tool, make sure you have:
A Resend API key (available from resend.com).
Permission to create or edit Tools in Frontline.
A verified sender domain in your Resend account.
Tip: You can adapt this same setup for other email providers (like SendGrid or Mailgun) as long as they accept JSON POST requests.
🚀 Step-by-step setup
1) Go to Tools
Log in to your Frontline Dashboard.
Navigate to Platform → Tools.
Click Create Tool.
2) Configure the tool
Set the Tool name (for example: Send Outbound Email).
In the When to use field, describe when your Agent should trigger this tool (e.g. use this tool when a new lead is created).
Select Custom Tool as the Tool type.
(See screenshot: Edit Custom Tool – selecting type Custom Tool.)
3) Connect your email API
Under API Request, choose POST as the method.
In the URL field, enter
https://api.resend.com/emails.Add the following HTTP Header:
Key:
AuthorizationValue:
Bearer YOUR_API_KEY
In the Request Body, enter this JSON structure:
{ "from": "Frontline <[email protected]>", "to": ["{email}"], "cc": ["[email protected]"], "subject": "New Lead from Frontline - Conversation Summary", "html": "<p><strong>New lead received!</strong><br>Check the summary in your dashboard.</p>" }Add one or more data inputs such as
emailto dynamically pull information from the conversation.
(See screenshot: Connect your API – Email example.)
4) Test your connection
Click Test Response.
If successful, you’ll see a
200 OKresponse and receive a test email in your inbox.Click Save Tool to finish.
🧠 How it works
When your AI Agent triggers this tool, Frontline sends the JSON payload to the Resend API. Variables like {email} are automatically filled with the live data captured during the conversation.
✅ Best practices
Use a verified sender domain to prevent delivery issues.
Keep subjects short and relevant.
Format your emails using HTML for clear, readable layouts.
Test using an internal email before sending to customers.
🔍 Troubleshooting
401 Unauthorized: Check that your Resend API key is valid and active.
400 Bad Request: Verify that your JSON structure matches Resend’s API format.
Email not received: Check your spam folder or verify sender domain setup in Resend.
Example output
A successful email will appear in your inbox as:
Subject: New Lead from Frontline - Conversation Summary
From: Frontline [email protected]
Body: New lead received! Check the summary in your dashboard.
Still have questions?
Reach out through the Help button in Frontline or contact your CSM for assistance.
