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.
List of Resend Components
Quickly compare Resend components by what they do and their key I/O.
Component | Action | What it Does | Inputs | Key Outputs | Use Case |
---|---|---|---|---|---|
Send Email | Write | Sends an email with specified content to one or more recipients. | required From , To , Subject , Text | id | Sending welcome emails or password resets. |
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
- Log in to your Resend account.
- Navigate to the API Keys section in the left-hand menu.
- Click the + Create API Key button.
- Give your key a name (e.g., "SmythOS Agent") and set the permission to Full access.
- Click Add.
- 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.
- In your SmythOS dashboard, navigate to the Vault.
- Create a new secret and paste your Resend API Key as the value. Give it a memorable name, like
resend_api_key
. - For more details, see the Vault Documentation.
Step 3: Configure the Resend Component
- In your SmythOS agent graph, drag and drop the Send Email component.
- Click the component to open its Settings panel.
- In the
Authentication Key
field, select the secret you saved in the Vault (e.g.,resend_api_key
). - Your connection is now configured for that component.
Which Resend Component Should I Use?
If you need to… | Target | Use this Component | Why this one? |
---|---|---|---|
Send any kind of email | One or more recipients | Send Email | This 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.
Inputs
Field | Type | Required | Notes |
---|---|---|---|
From | string | Yes | The sender's email address (e.g., You <you@example.com> ). Must use a domain verified in Resend. |
To | string/array | Yes | The recipient's email address. Can be a single string or an array of strings for multiple recipients. |
Subject | string | Yes | The subject line of the email. |
Text | string | Yes | The plain text body content of the email. You can also pass HTML content here. |
Outputs
Field | Type | Description |
---|---|---|
id | string | The unique ID of the sent email, useful for tracking. |
Response | object | The full, raw JSON response from the Resend API, containing the id and other details. |
Headers | object | The HTTP headers from the API response. |
{
"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>"
}
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.