Skip to main content

Example: Sending Outbound Emails

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.

Alvaro Vargas avatar
Written by Alvaro Vargas
Updated over a week ago

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

  1. Log in to your Frontline Dashboard.

  2. Navigate to Platform → Tools.

  3. Click Create Tool.

2) Configure the tool

  1. Set the Tool name (for example: Send Outbound Email).

  2. 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).

  3. Select Custom Tool as the Tool type.

(See screenshot: Edit Custom Tool – selecting type Custom Tool.)

3) Connect your email API

  1. Under API Request, choose POST as the method.

  2. In the URL field, enter https://api.resend.com/emails.

  3. Add the following HTTP Header:

    • Key: Authorization

    • Value: Bearer YOUR_API_KEY

  4. 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>" }
  1. Add one or more data inputs such as email to dynamically pull information from the conversation.

(See screenshot: Connect your API – Email example.)

4) Test your connection

  1. Click Test Response.

  2. If successful, you’ll see a 200 OK response and receive a test email in your inbox.

  3. 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.

Did this answer your question?