Skip to main content

Resend Integration with SmythOS

Need a simple, developer-friendly way to send emails from your agents? Connect Resend to SmythOS and empower your agents to send transactional emails programmatically with ease.

TL;DR

Securely link your Resend account to SmythOS using an API key. Then, use the "Send Email" component to automate all your transactional email needs, from sending welcome messages to critical system alerts.

List of Resend Components

Quickly compare Resend components by what they do and their key I/O.

ComponentActionWhat it DoesInputsKey OutputsUse Case
Send EmailWriteSends an email with specified content to one or more recipients.required From, To, Subject, TextidSending welcome emails or password resets.
INFO
Why Integrate Resend with Your Agent?

Resend is a modern email platform designed for developers. Integrating it with SmythOS allows you to build reliable and powerful communication workflows.

  • Automate Transactional Emails: Create agents that automatically send critical emails like account verifications, password resets, order confirmations, and invoices, ensuring reliable delivery.
  • Reliable Alerting System: When an agent detects an important event—a system failure, a new high-value customer—it can use Resend to send a dependable email alert to the right people.
  • Streamline User Onboarding: Build an agent that, upon a new user sign-up, sends a beautifully formatted welcome email, starting the customer relationship on the right foot.
  • Centralize Email Logic: Manage all your application's transactional email logic from within SmythOS agents, making it easy to update, monitor, and control your email communications.

Prerequisites

Before you begin, please ensure you have the following:

  • An active SmythOS account. (Sign up here).
  • A Resend account.
  • A Resend API Key.
  • A verified domain in your Resend account to send emails from.

Getting Started With Resend

The connection between SmythOS and Resend is configured using a secure API Key.

Step 1: Get Your Resend API Key

  1. Log in to your Resend account.
  2. Navigate to the API Keys section in the left-hand menu.
  3. Click the + Create API Key button.
  4. Give your key a name (e.g., "SmythOS Agent") and set the permission to Full access.
  5. Click Add.
  6. Copy the API key immediately. It will not be shown again for security reasons.

Step 2: Store Your API Key in SmythOS Vault

Your API Key is a sensitive credential. Use the SmythOS Vault to store it securely.

  1. In your SmythOS dashboard, navigate to the Vault.
  2. Create a new secret and paste your Resend API Key as the value. Give it a memorable name, like resend_api_key.
  3. For more details, see the Vault Documentation.

Step 3: Configure the Resend Component

  1. In your SmythOS agent graph, drag and drop the Send Email component.
  2. Click the component to open its Settings panel.
  3. In the Authentication Key field, select the secret you saved in the Vault (e.g., resend_api_key).
  4. Your connection is now configured for that component.
Heads-up
You must add the API Key from the Vault to each Resend component you use. This ensures all your API calls are properly authenticated.

Which Resend Component Should I Use?

If you need to…TargetUse this ComponentWhy this one?
Send any kind of emailOne or more recipientsSend EmailThis is the core, all-in-one component for sending emails with Resend.

Component Details

This section provides detailed information for the Resend component.

Send Email

Sends an email with a specified subject and content to one or more recipients. The content can be plain text or HTML.

INFO
This component requires an API Key for authentication, as detailed in the Getting Started section.

Inputs

FieldTypeRequiredNotes
FromstringYesThe sender's email address (e.g., You <you@example.com>). Must use a domain verified in Resend.
Tostring/arrayYesThe recipient's email address. Can be a single string or an array of strings for multiple recipients.
SubjectstringYesThe subject line of the email.
TextstringYesThe plain text body content of the email. You can also pass HTML content here.

Outputs

FieldTypeDescription
idstringThe unique ID of the sent email, useful for tracking.
ResponseobjectThe full, raw JSON response from the Resend API, containing the id and other details.
HeadersobjectThe HTTP headers from the API response.
Use Case

An agent processes a password reset request. It generates a unique reset link, and then calls this component to send an email to the user with the subject "Your Password Reset Link" and the link in the Text body.

{
"component": "resend.sendEmail",
"From": "Onboarding Team <onboarding@example.com>",
"To": "new.user@example.com",
"Subject": "Welcome to SmythOS!",
"Text": "<h1>Welcome aboard!</h1><p>We're so glad to have you. Let us know if you need anything.</p>"
}
Verified Domain Required

To send emails in a production environment, you must verify your domain in Resend. Emails sent from unverified domains will fail.

Best Practices & Advanced Tips

  • Secure Your API Key: Always store your Resend API key in the SmythOS Vault.
  • Use HTML for Rich Emails: The Text input can accept a full HTML string. Use this to send beautifully designed emails. For more complex designs, consider building the HTML outside the agent and passing it in as a variable.
  • Verify Your Domain: The most critical step for deliverability is to complete the Domain Authentication process in your Resend account. This improves your sending reputation and ensures your emails don't land in spam.
  • Handle Bounces and Complaints: Use the Resend dashboard to monitor your email activity. If you see high bounce or complaint rates, investigate the causes to protect your sender reputation.

Troubleshooting Common Issues

  • Error: 401 Unauthorized

    • Cause: The API Key is incorrect or has been revoked.
    • Solution: Verify that the API Key in your SmythOS Vault is correct and active. Generate a new key in Resend if necessary and update your Vault secret.
  • Error: 422 Unprocessable Entity / "You must verify your domain to send emails"

    • Cause: You are trying to send an email from a domain that has not been verified in your Resend account.
    • Solution: Log in to your Resend account, go to the Domains section, and follow the instructions to add and verify your sending domain by adding DNS records.
  • Emails Go to Spam

    • Cause: This is a complex deliverability issue often related to a new domain's reputation or the content of the email.
    • Solution: Ensure your domain is fully verified in Resend (with DKIM/SPF). Warm up your domain by sending a small volume of high-quality emails first. Avoid spammy words in your subject and content.

What's Next?

You are now ready to build powerful email workflows with the SmythOS Resend Integration!

Consider these ideas:

  • Build an Agent That...

    • Manages a product waitlist. When a user signs up, the agent adds them to a database. When the product launches, the agent iterates through the list and sends a personalized launch announcement email to each user.
    • Sends a daily summary report. The agent gathers data from various sources (Google Analytics, internal databases), formats it into an HTML report, and emails it to stakeholders.
    • Powers an alert system. When a system monitoring tool detects an issue, it triggers an agent that sends a high-priority email alert to the on-call engineering team.
  • Explore Other Integrations:

    • Combine Resend with a database integration like Firestore. When a new record is added, trigger an agent to send a confirmation email.
    • Use an LLM component to draft a personalized follow-up email based on a customer's recent activity, then send it via Resend.
    • Connect to a payment processor. When a subscription payment fails, send a dunning email to the customer asking them to update their payment information.