feat(tools): added resend email sender (#1420)

This commit is contained in:
Waleed
2025-09-22 19:16:42 -07:00
committed by GitHub
parent 2f97782df0
commit f1b83c1988
18 changed files with 195 additions and 318 deletions

View File

@@ -54,6 +54,7 @@ With Google Forms, you can:
In Sim, the Google Forms integration enables your agents to programmatically access form responses. This allows for powerful automation scenarios such as processing survey data, triggering workflows based on new submissions, and syncing form results with other tools. Your agents can fetch all responses for a form, retrieve a specific response, and use the data to drive intelligent automation. By connecting Sim with Google Forms, you can automate data collection, streamline feedback processing, and incorporate form responses into your agent's capabilities.
{/* MANUAL-CONTENT-END */}
## Usage Instructions
Integrate Google Forms into your workflow. Provide a Form ID to list responses, or specify a Response ID to fetch a single response. Requires OAuth.

View File

@@ -1,70 +0,0 @@
---
title: Mail
description: Send emails using the internal mail service
---
import { BlockInfoCard } from "@/components/ui/block-info-card"
<BlockInfoCard
type="mail"
color="#181C1E"
icon={true}
iconSvg={`<svg className="block-icon"
viewBox='0 0 30 24'
fill='none'
xmlns='http://www.w3.org/2000/svg'
>
<path
d='M2.35742 5.83288L11.7674 12.1071C13.0656 12.9712 13.7141 13.404 14.4151 13.5725C15.0352 13.7208 15.681 13.7208 16.2998 13.5725C17.0008 13.404 17.6492 12.9712 18.9475 12.1071L28.3574 5.83288M8.82844 21.7219H21.8864C24.1513 21.7219 25.2837 21.7219 26.1492 21.2811C26.9097 20.8931 27.5278 20.2744 27.9152 19.5137C28.3574 18.6482 28.3574 17.5158 28.3574 15.2509V7.97102C28.3574 5.70616 28.3574 4.57373 27.9166 3.70823C27.5288 2.94727 26.9102 2.32858 26.1492 1.94084C25.2837 1.5 24.1513 1.5 21.8864 1.5H8.82844C6.56358 1.5 5.43115 1.5 4.56566 1.94084C3.80519 2.32881 3.187 2.94747 2.79961 3.70823C2.35742 4.57373 2.35742 5.70616 2.35742 7.97102V15.2509C2.35742 17.5158 2.35742 18.6482 2.79826 19.5137C3.186 20.2747 3.80469 20.8933 4.56566 21.2811C5.43115 21.7219 6.56358 21.7219 8.82844 21.7219Z'
stroke='currentColor'
strokeWidth='2.5'
strokeLinecap='round'
strokeLinejoin='round'
/>
</svg>`}
/>
{/* MANUAL-CONTENT-START:intro */}
The Mail block allows you to send emails directly from your workflows using Sim's own mail sending infrastructure powered by [Resend](https://resend.com/). This integration enables you to programmatically deliver notifications, alerts, and other important information to users' email addresses without requiring any external configuration or OAuth.
Our internal mail service is designed for reliability and ease of use, making it ideal for automating communications and ensuring your messages reach recipients efficiently.
{/* MANUAL-CONTENT-END */}
## Usage Instructions
Send emails directly using the internal mail service. Uses MAIL_BLOCK_FROM_ADDRESS if configured, otherwise falls back to FROM_EMAIL_ADDRESS. No external configuration or OAuth required. Perfect for sending notifications, alerts, or general purpose emails from your workflows. Supports HTML formatting.
## Tools
### `mail_send`
Send an email using the internal mail service without requiring OAuth or external configuration
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `to` | string | Yes | Recipient email address |
| `subject` | string | Yes | Email subject |
| `body` | string | Yes | Email body content |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether the email was sent successfully |
| `to` | string | Recipient email address |
| `subject` | string | Email subject |
| `body` | string | Email body content |
## Notes
- Category: `tools`
- Type: `mail`

View File

@@ -28,7 +28,6 @@
"knowledge",
"linear",
"linkup",
"mail",
"mcp",
"mem0",
"memory",
@@ -48,6 +47,7 @@
"postgresql",
"qdrant",
"reddit",
"resend",
"s3",
"schedule",
"serper",

View File

@@ -0,0 +1,78 @@
---
title: Resend
description: Send emails with Resend.
---
import { BlockInfoCard } from "@/components/ui/block-info-card"
<BlockInfoCard
type="resend"
color="#181C1E"
icon={true}
iconSvg={`<svg className="block-icon"
viewBox='0 0 1800 1800'
fill='none'
xmlns='http://www.w3.org/2000/svg'
>
<path
d='M1000.46 450C1174.77 450 1278.43 553.669 1278.43 691.282C1278.43 828.896 1174.77 932.563 1000.46 932.563H912.382L1350 1350H1040.82L707.794 1033.48C683.944 1011.47 672.936 985.781 672.935 963.765C672.935 932.572 694.959 905.049 737.161 893.122L908.712 847.244C973.85 829.812 1018.81 779.353 1018.81 713.298C1018.8 632.567 952.745 585.78 871.095 585.78H450V450H1000.46Z'
fill='#FDFDFD'
/>
</svg>`}
/>
{/* MANUAL-CONTENT-START:intro */}
[Resend](https://resend.com/) is a modern email service designed for developers to send transactional and marketing emails with ease. It provides a simple, reliable API and dashboard for managing email delivery, templates, and analytics, making it a popular choice for integrating email functionality into applications and workflows.
With Resend, you can:
- **Send transactional emails**: Deliver password resets, notifications, confirmations, and more with high deliverability
- **Manage templates**: Create and update email templates for consistent branding and messaging
- **Track analytics**: Monitor delivery, open, and click rates to optimize your email performance
- **Integrate easily**: Use a straightforward API and SDKs for seamless integration with your applications
- **Ensure security**: Benefit from robust authentication and domain verification to protect your email reputation
In Sim, the Resend integration allows your agents to programmatically send emails as part of your automated workflows. This enables use cases such as sending notifications, alerts, or custom messages directly from your Sim-powered agents. By connecting Sim with Resend, you can automate communication tasks, ensuring timely and reliable email delivery without manual intervention. The integration leverages your Resend API key, keeping your credentials secure while enabling powerful email automation scenarios.
{/* MANUAL-CONTENT-END */}
## Usage Instructions
Integrate Resend into the workflow. Can send emails. Requires API Key.
## Tools
### `resend_send`
Send an email using your own Resend API key and from address
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `fromAddress` | string | Yes | Email address to send from |
| `to` | string | Yes | Recipient email address |
| `subject` | string | Yes | Email subject |
| `body` | string | Yes | Email body content |
| `resendApiKey` | string | Yes | Resend API key for sending emails |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether the email was sent successfully |
| `to` | string | Recipient email address |
| `subject` | string | Email subject |
| `body` | string | Email body content |
## Notes
- Category: `tools`
- Type: `resend`

View File

@@ -9,7 +9,16 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"
type="sms"
color="#E0E0E0"
icon={true}
iconSvg={`<svg className="block-icon" fill="#000000" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d="M 2 5 L 2 25 L 7 25 L 7 30.09375 L 8.625 28.78125 L 13.34375 25 L 30 25 L 30 5 Z M 4 7 L 28 7 L 28 23 L 12.65625 23 L 12.375 23.21875 L 9 25.90625 L 9 23 L 4 23 Z M 8 12 L 8 14 L 24 14 L 24 12 Z M 8 16 L 8 18 L 20 18 L 20 16 Z"/></svg>`}
iconSvg={`<svg className="block-icon"
fill='#000000'
viewBox='0 0 32 32'
xmlns='http://www.w3.org/2000/svg'
>
<path d='M 2 5 L 2 25 L 7 25 L 7 30.09375 L 8.625 28.78125 L 13.34375 25 L 30 25 L 30 5 Z M 4 7 L 28 7 L 28 23 L 12.65625 23 L 12.375 23.21875 L 9 25.90625 L 9 23 L 4 23 Z M 8 12 L 8 14 L 24 14 L 24 12 Z M 8 16 L 8 18 L 20 18 L 20 16 Z' />
</svg>`}
/>
{/* MANUAL-CONTENT-START:intro */}
@@ -18,6 +27,7 @@ The SMS block allows you to send text messages directly from your workflows usin
Our internal SMS service is designed for reliability and ease of use, making it ideal for automating communications and ensuring your messages reach recipients efficiently.
{/* MANUAL-CONTENT-END */}
## Usage Instructions
Send SMS messages directly using the internal SMS service powered by Twilio. No external configuration or OAuth required. Perfect for sending notifications, alerts, or general purpose text messages from your workflows. Requires valid phone numbers with country codes.

View File

@@ -1,66 +0,0 @@
---
title: Correo
description: Envía correos electrónicos utilizando el servicio de correo interno
---
import { BlockInfoCard } from "@/components/ui/block-info-card"
<BlockInfoCard
type="mail"
color="#181C1E"
icon={true}
iconSvg={`<svg className="block-icon"
viewBox='0 0 30 24'
fill='none'
xmlns='http://www.w3.org/2000/svg'
>
<path
d='M2.35742 5.83288L11.7674 12.1071C13.0656 12.9712 13.7141 13.404 14.4151 13.5725C15.0352 13.7208 15.681 13.7208 16.2998 13.5725C17.0008 13.404 17.6492 12.9712 18.9475 12.1071L28.3574 5.83288M8.82844 21.7219H21.8864C24.1513 21.7219 25.2837 21.7219 26.1492 21.2811C26.9097 20.8931 27.5278 20.2744 27.9152 19.5137C28.3574 18.6482 28.3574 17.5158 28.3574 15.2509V7.97102C28.3574 5.70616 28.3574 4.57373 27.9166 3.70823C27.5288 2.94727 26.9102 2.32858 26.1492 1.94084C25.2837 1.5 24.1513 1.5 21.8864 1.5H8.82844C6.56358 1.5 5.43115 1.5 4.56566 1.94084C3.80519 2.32881 3.187 2.94747 2.79961 3.70823C2.35742 4.57373 2.35742 5.70616 2.35742 7.97102V15.2509C2.35742 17.5158 2.35742 18.6482 2.79826 19.5137C3.186 20.2747 3.80469 20.8933 4.56566 21.2811C5.43115 21.7219 6.56358 21.7219 8.82844 21.7219Z'
stroke='currentColor'
strokeWidth='2.5'
strokeLinecap='round'
strokeLinejoin='round'
/>
</svg>`}
/>
{/* MANUAL-CONTENT-START:intro */}
El bloque de Correo te permite enviar correos electrónicos directamente desde tus flujos de trabajo utilizando la infraestructura de envío de correo de Sim, impulsada por [Resend](https://resend.com/). Esta integración te permite entregar programáticamente notificaciones, alertas y otra información importante a las direcciones de correo electrónico de los usuarios sin requerir ninguna configuración externa o OAuth.
Nuestro servicio de correo interno está diseñado para ser confiable y fácil de usar, lo que lo hace ideal para automatizar comunicaciones y asegurar que tus mensajes lleguen a los destinatarios de manera eficiente.
{/* MANUAL-CONTENT-END */}
## Instrucciones de uso
Envía correos electrónicos directamente utilizando el servicio de correo interno. Utiliza MAIL_BLOCK_FROM_ADDRESS si está configurado, de lo contrario, usa FROM_EMAIL_ADDRESS como alternativa. No requiere configuración externa ni OAuth. Perfecto para enviar notificaciones, alertas o correos electrónicos de propósito general desde tus flujos de trabajo. Compatible con formato HTML.
## Herramientas
### `mail_send`
Envía un correo electrónico utilizando el servicio de correo interno sin requerir OAuth o configuración externa
#### Entrada
| Parámetro | Tipo | Obligatorio | Descripción |
| --------- | ---- | -------- | ----------- |
| `to` | string | Sí | Dirección de correo electrónico del destinatario |
| `subject` | string | Sí | Asunto del correo electrónico |
| `body` | string | Sí | Contenido del cuerpo del correo electrónico |
#### Salida
| Parámetro | Tipo | Descripción |
| --------- | ---- | ----------- |
| `success` | boolean | Si el correo electrónico se envió correctamente |
| `to` | string | Dirección de correo electrónico del destinatario |
| `subject` | string | Asunto del correo electrónico |
| `body` | string | Contenido del cuerpo del correo electrónico |
## Notas
- Categoría: `tools`
- Tipo: `mail`

View File

@@ -1,66 +0,0 @@
---
title: Mail
description: Envoyez des emails en utilisant le service de messagerie interne
---
import { BlockInfoCard } from "@/components/ui/block-info-card"
<BlockInfoCard
type="mail"
color="#181C1E"
icon={true}
iconSvg={`<svg className="block-icon"
viewBox='0 0 30 24'
fill='none'
xmlns='http://www.w3.org/2000/svg'
>
<path
d='M2.35742 5.83288L11.7674 12.1071C13.0656 12.9712 13.7141 13.404 14.4151 13.5725C15.0352 13.7208 15.681 13.7208 16.2998 13.5725C17.0008 13.404 17.6492 12.9712 18.9475 12.1071L28.3574 5.83288M8.82844 21.7219H21.8864C24.1513 21.7219 25.2837 21.7219 26.1492 21.2811C26.9097 20.8931 27.5278 20.2744 27.9152 19.5137C28.3574 18.6482 28.3574 17.5158 28.3574 15.2509V7.97102C28.3574 5.70616 28.3574 4.57373 27.9166 3.70823C27.5288 2.94727 26.9102 2.32858 26.1492 1.94084C25.2837 1.5 24.1513 1.5 21.8864 1.5H8.82844C6.56358 1.5 5.43115 1.5 4.56566 1.94084C3.80519 2.32881 3.187 2.94747 2.79961 3.70823C2.35742 4.57373 2.35742 5.70616 2.35742 7.97102V15.2509C2.35742 17.5158 2.35742 18.6482 2.79826 19.5137C3.186 20.2747 3.80469 20.8933 4.56566 21.2811C5.43115 21.7219 6.56358 21.7219 8.82844 21.7219Z'
stroke='currentColor'
strokeWidth='2.5'
strokeLinecap='round'
strokeLinejoin='round'
/>
</svg>`}
/>
{/* MANUAL-CONTENT-START:intro */}
Le bloc Mail vous permet d'envoyer des emails directement depuis vos workflows en utilisant l'infrastructure d'envoi de mail de Sim, propulsée par [Resend](https://resend.com/). Cette intégration vous permet d'envoyer par programmation des notifications, des alertes et d'autres informations importantes aux adresses email des utilisateurs sans nécessiter de configuration externe ou d'OAuth.
Notre service de messagerie interne est conçu pour être fiable et facile à utiliser, ce qui le rend idéal pour automatiser les communications et garantir que vos messages atteignent efficacement les destinataires.
{/* MANUAL-CONTENT-END */}
## Instructions d'utilisation
Envoyez des emails directement en utilisant le service de messagerie interne. Utilise MAIL_BLOCK_FROM_ADDRESS si configuré, sinon utilise FROM_EMAIL_ADDRESS par défaut. Aucune configuration externe ou OAuth n'est requise. Parfait pour envoyer des notifications, des alertes ou des emails à usage général depuis vos workflows. Prend en charge le formatage HTML.
## Outils
### `mail_send`
Envoyer un email en utilisant le service de messagerie interne sans nécessiter d'OAuth ou de configuration externe
#### Entrée
| Paramètre | Type | Obligatoire | Description |
| --------- | ---- | ---------- | ----------- |
| `to` | string | Oui | Adresse e-mail du destinataire |
| `subject` | string | Oui | Objet de l'e-mail |
| `body` | string | Oui | Contenu du corps de l'e-mail |
#### Sortie
| Paramètre | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Indique si l'e-mail a été envoyé avec succès |
| `to` | string | Adresse e-mail du destinataire |
| `subject` | string | Objet de l'e-mail |
| `body` | string | Contenu du corps de l'e-mail |
## Notes
- Catégorie : `tools`
- Type : `mail`

View File

@@ -1,66 +0,0 @@
---
title: 邮件
description: 使用内部邮件服务发送电子邮件
---
import { BlockInfoCard } from "@/components/ui/block-info-card"
<BlockInfoCard
type="mail"
color="#181C1E"
icon={true}
iconSvg={`<svg className="block-icon"
viewBox='0 0 30 24'
fill='none'
xmlns='http://www.w3.org/2000/svg'
>
<path
d='M2.35742 5.83288L11.7674 12.1071C13.0656 12.9712 13.7141 13.404 14.4151 13.5725C15.0352 13.7208 15.681 13.7208 16.2998 13.5725C17.0008 13.404 17.6492 12.9712 18.9475 12.1071L28.3574 5.83288M8.82844 21.7219H21.8864C24.1513 21.7219 25.2837 21.7219 26.1492 21.2811C26.9097 20.8931 27.5278 20.2744 27.9152 19.5137C28.3574 18.6482 28.3574 17.5158 28.3574 15.2509V7.97102C28.3574 5.70616 28.3574 4.57373 27.9166 3.70823C27.5288 2.94727 26.9102 2.32858 26.1492 1.94084C25.2837 1.5 24.1513 1.5 21.8864 1.5H8.82844C6.56358 1.5 5.43115 1.5 4.56566 1.94084C3.80519 2.32881 3.187 2.94747 2.79961 3.70823C2.35742 4.57373 2.35742 5.70616 2.35742 7.97102V15.2509C2.35742 17.5158 2.35742 18.6482 2.79826 19.5137C3.186 20.2747 3.80469 20.8933 4.56566 21.2811C5.43115 21.7219 6.56358 21.7219 8.82844 21.7219Z'
stroke='currentColor'
strokeWidth='2.5'
strokeLinecap='round'
strokeLinejoin='round'
/>
</svg>`}
/>
{/* MANUAL-CONTENT-START:intro */}
Mail 模块允许您通过 Sim 自有的邮件发送基础设施(由 [Resend](https://resend.com/) 提供支持)直接从工作流中发送电子邮件。此集成使您能够以编程方式向用户的电子邮件地址发送通知、警报和其他重要信息,而无需任何外部配置或 OAuth。
我们的内部邮件服务专为可靠性和易用性而设计,非常适合自动化通信,确保您的消息高效地到达收件人。
{/* MANUAL-CONTENT-END */}
## 使用说明
直接使用内部邮件服务发送电子邮件。如果已配置 MAIL_BLOCK_FROM_ADDRESS则使用该地址否则将回退到 FROM_EMAIL_ADDRESS。无需外部配置或 OAuth非常适合从您的工作流中发送通知、警报或通用电子邮件。支持 HTML 格式。
## 工具
### `mail_send`
使用内部邮件服务发送电子邮件,无需 OAuth 或外部配置
#### 输入
| 参数 | 类型 | 必填 | 描述 |
| --------- | ---- | -------- | ----------- |
| `to` | string | 是 | 收件人邮箱地址 |
| `subject` | string | 是 | 邮件主题 |
| `body` | string | 是 | 邮件正文内容 |
#### 输出
| 参数 | 类型 | 描述 |
| --------- | ---- | ----------- |
| `success` | boolean | 邮件是否成功发送 |
| `to` | string | 收件人邮箱地址 |
| `subject` | string | 邮件主题 |
| `body` | string | 邮件正文内容 |
## 注意事项
- 分类: `tools`
- 类型: `mail`

View File

@@ -1,8 +1,7 @@
import { type NextRequest, NextResponse } from 'next/server'
import { Resend } from 'resend'
import { z } from 'zod'
import { checkHybridAuth } from '@/lib/auth/hybrid'
import { type EmailOptions, sendEmail } from '@/lib/email/mailer'
import { env } from '@/lib/env'
import { createLogger } from '@/lib/logs/console/logger'
import { generateRequestId } from '@/lib/utils'
@@ -11,9 +10,11 @@ export const dynamic = 'force-dynamic'
const logger = createLogger('MailSendAPI')
const MailSendSchema = z.object({
fromAddress: z.string().email('Invalid from email address').min(1, 'From address is required'),
to: z.string().email('Invalid email address').min(1, 'To email is required'),
subject: z.string().min(1, 'Subject is required'),
body: z.string().min(1, 'Email body is required'),
resendApiKey: z.string().min(1, 'Resend API key is required'),
})
export async function POST(request: NextRequest) {
@@ -40,38 +41,42 @@ export async function POST(request: NextRequest) {
const body = await request.json()
const validatedData = MailSendSchema.parse(body)
const fromAddress = env.MAIL_BLOCK_FROM_ADDRESS || env.FROM_EMAIL_ADDRESS
logger.info(`[${requestId}] Sending email with user-provided Resend API key`, {
to: validatedData.to,
subject: validatedData.subject,
bodyLength: validatedData.body.length,
from: validatedData.fromAddress,
})
if (!fromAddress) {
logger.error(`[${requestId}] Email sending failed: No from address configured`)
const resend = new Resend(validatedData.resendApiKey)
const emailData = {
from: validatedData.fromAddress,
to: validatedData.to,
subject: validatedData.subject,
html: validatedData.body,
text: validatedData.body.replace(/<[^>]*>/g, ''), // Strip HTML for text version
}
const { data, error } = await resend.emails.send(emailData)
if (error) {
logger.error(`[${requestId}] Email sending failed:`, error)
return NextResponse.json(
{
success: false,
message: 'Email sending failed: No from address configured.',
message: `Failed to send email: ${error.message || 'Unknown error'}`,
},
{ status: 500 }
)
}
logger.info(`[${requestId}] Sending email via internal mail API`, {
to: validatedData.to,
subject: validatedData.subject,
bodyLength: validatedData.body.length,
from: fromAddress,
})
const emailOptions: EmailOptions = {
to: validatedData.to,
subject: validatedData.subject,
html: validatedData.body,
text: validatedData.body.replace(/<[^>]*>/g, ''),
from: fromAddress, // Use the determined FROM address
emailType: 'transactional',
includeUnsubscribe: false,
const result = {
success: true,
message: 'Email sent successfully via Resend',
data,
}
const result = await sendEmail(emailOptions)
logger.info(`[${requestId}] Email send result`, {
success: result.success,
message: result.message,

View File

@@ -1,18 +1,26 @@
import { MailIcon } from '@/components/icons'
import { ResendIcon } from '@/components/icons'
import type { BlockConfig } from '@/blocks/types'
import type { MailSendResult } from '@/tools/mail/types'
import type { MailSendResult } from '@/tools/resend/types'
export const MailBlock: BlockConfig<MailSendResult> = {
type: 'mail',
name: 'Mail',
description: 'Send emails using the internal mail service',
longDescription:
'Send emails directly using the internal mail service. Uses MAIL_BLOCK_FROM_ADDRESS if configured, otherwise falls back to FROM_EMAIL_ADDRESS. No external configuration or OAuth required. Perfect for sending notifications, alerts, or general purpose emails from your workflows. Supports HTML formatting.',
export const ResendBlock: BlockConfig<MailSendResult> = {
type: 'resend',
name: 'Resend',
description: 'Send emails with Resend.',
longDescription: 'Integrate Resend into the workflow. Can send emails. Requires API Key.',
docsLink: 'https://docs.sim.ai/tools/resend',
category: 'tools',
bgColor: '#E0E0E0',
icon: MailIcon,
bgColor: '#181C1E',
icon: ResendIcon,
subBlocks: [
{
id: 'fromAddress',
title: 'From Address',
type: 'short-input',
layout: 'full',
placeholder: 'sender@yourdomain.com',
required: true,
},
{
id: 'to',
title: 'To',
@@ -34,16 +42,27 @@ export const MailBlock: BlockConfig<MailSendResult> = {
title: 'Body',
type: 'long-input',
layout: 'full',
placeholder: 'Email body content (HTML supported)',
placeholder: 'Email body content',
required: true,
},
{
id: 'resendApiKey',
title: 'Resend API Key',
type: 'short-input',
layout: 'full',
placeholder: 'Your Resend API key',
required: true,
password: true,
},
],
tools: {
access: ['mail_send'],
access: ['resend_send'],
config: {
tool: () => 'mail_send',
tool: () => 'resend_send',
params: (params) => ({
resendApiKey: params.resendApiKey,
fromAddress: params.fromAddress,
to: params.to,
subject: params.subject,
body: params.body,
@@ -52,9 +71,11 @@ export const MailBlock: BlockConfig<MailSendResult> = {
},
inputs: {
fromAddress: { type: 'string', description: 'Email address to send from' },
to: { type: 'string', description: 'Recipient email address' },
subject: { type: 'string', description: 'Email subject' },
body: { type: 'string', description: 'Email body content' },
resendApiKey: { type: 'string', description: 'Resend API key for sending emails' },
},
outputs: {

View File

@@ -35,7 +35,6 @@ import { JiraBlock } from '@/blocks/blocks/jira'
import { KnowledgeBlock } from '@/blocks/blocks/knowledge'
import { LinearBlock } from '@/blocks/blocks/linear'
import { LinkupBlock } from '@/blocks/blocks/linkup'
import { MailBlock } from '@/blocks/blocks/mail'
import { McpBlock } from '@/blocks/blocks/mcp'
import { Mem0Block } from '@/blocks/blocks/mem0'
import { MemoryBlock } from '@/blocks/blocks/memory'
@@ -55,6 +54,7 @@ import { PineconeBlock } from '@/blocks/blocks/pinecone'
import { PostgreSQLBlock } from '@/blocks/blocks/postgresql'
import { QdrantBlock } from '@/blocks/blocks/qdrant'
import { RedditBlock } from '@/blocks/blocks/reddit'
import { ResendBlock } from '@/blocks/blocks/resend'
import { ResponseBlock } from '@/blocks/blocks/response'
import { RouterBlock } from '@/blocks/blocks/router'
import { S3Block } from '@/blocks/blocks/s3'
@@ -116,7 +116,6 @@ export const registry: Record<string, BlockConfig> = {
knowledge: KnowledgeBlock,
linear: LinearBlock,
linkup: LinkupBlock,
mail: MailBlock,
mcp: McpBlock,
mem0: Mem0Block,
microsoft_excel: MicrosoftExcelBlock,
@@ -134,6 +133,7 @@ export const registry: Record<string, BlockConfig> = {
pinecone: PineconeBlock,
postgresql: PostgreSQLBlock,
qdrant: QdrantBlock,
resend: ResendBlock,
memory: MemoryBlock,
reddit: RedditBlock,
response: ResponseBlock,

View File

@@ -3695,3 +3695,19 @@ export const SMSIcon = (props: SVGProps<SVGSVGElement>) => (
<path d='M 2 5 L 2 25 L 7 25 L 7 30.09375 L 8.625 28.78125 L 13.34375 25 L 30 25 L 30 5 Z M 4 7 L 28 7 L 28 23 L 12.65625 23 L 12.375 23.21875 L 9 25.90625 L 9 23 L 4 23 Z M 8 12 L 8 14 L 24 14 L 24 12 Z M 8 16 L 8 18 L 20 18 L 20 16 Z' />
</svg>
)
export const ResendIcon = (props: SVGProps<SVGSVGElement>) => (
<svg
{...props}
width='1800'
height='1800'
viewBox='0 0 1800 1800'
fill='none'
xmlns='http://www.w3.org/2000/svg'
>
<path
d='M1000.46 450C1174.77 450 1278.43 553.669 1278.43 691.282C1278.43 828.896 1174.77 932.563 1000.46 932.563H912.382L1350 1350H1040.82L707.794 1033.48C683.944 1011.47 672.936 985.781 672.935 963.765C672.935 932.572 694.959 905.049 737.161 893.122L908.712 847.244C973.85 829.812 1018.81 779.353 1018.81 713.298C1018.8 632.567 952.745 585.78 871.095 585.78H450V450H1000.46Z'
fill='#FDFDFD'
/>
</svg>
)

View File

@@ -55,7 +55,6 @@ export const env = createEnv({
RESEND_API_KEY: z.string().min(1).optional(), // Resend API key for transactional emails
FROM_EMAIL_ADDRESS: z.string().min(1).optional(), // Complete from address (e.g., "Sim <noreply@domain.com>" or "noreply@domain.com")
EMAIL_DOMAIN: z.string().min(1).optional(), // Domain for sending emails (fallback when FROM_EMAIL_ADDRESS not set)
MAIL_BLOCK_FROM_ADDRESS: z.string().min(1).optional(), // Custom from address for mail block tool (e.g., "Bot <bot@domain.com>")
AZURE_ACS_CONNECTION_STRING: z.string().optional(), // Azure Communication Services connection string
// SMS & Messaging

View File

@@ -1,3 +0,0 @@
import { mailSendTool } from '@/tools/mail/send'
export { mailSendTool }

View File

@@ -74,7 +74,6 @@ import {
} from '@/tools/knowledge'
import { linearCreateIssueTool, linearReadIssuesTool } from '@/tools/linear'
import { linkupSearchTool } from '@/tools/linkup'
import { mailSendTool } from '@/tools/mail'
import { mem0AddMemoriesTool, mem0GetMemoriesTool, mem0SearchMemoriesTool } from '@/tools/mem0'
import { memoryAddTool, memoryDeleteTool, memoryGetAllTool, memoryGetTool } from '@/tools/memory'
import {
@@ -142,6 +141,7 @@ import {
} from '@/tools/postgresql'
import { qdrantFetchTool, qdrantSearchTool, qdrantUpsertTool } from '@/tools/qdrant'
import { redditGetCommentsTool, redditGetPostsTool, redditHotPostsTool } from '@/tools/reddit'
import { mailSendTool } from '@/tools/resend'
import { s3GetObjectTool } from '@/tools/s3'
import { searchTool as serperSearch } from '@/tools/serper'
import {
@@ -208,7 +208,7 @@ export const tools: Record<string, ToolConfig> = {
google_search: googleSearchTool,
jina_read_url: readUrlTool,
linkup_search: linkupSearchTool,
mail_send: mailSendTool,
resend_send: mailSendTool,
sms_send: smsSendTool,
jira_retrieve: jiraRetrieveTool,
jira_update: jiraUpdateTool,

View File

@@ -0,0 +1,3 @@
import { mailSendTool } from '@/tools/resend/send'
export { mailSendTool }

View File

@@ -1,14 +1,19 @@
import type { MailSendParams, MailSendResult } from '@/tools/mail/types'
import type { MailSendParams, MailSendResult } from '@/tools/resend/types'
import type { ToolConfig } from '@/tools/types'
export const mailSendTool: ToolConfig<MailSendParams, MailSendResult> = {
id: 'mail_send',
id: 'resend_send',
name: 'Send Email',
description:
'Send an email using the internal mail service without requiring OAuth or external configuration',
description: 'Send an email using your own Resend API key and from address',
version: '1.0.0',
params: {
fromAddress: {
type: 'string',
required: true,
visibility: 'user-only',
description: 'Email address to send from',
},
to: {
type: 'string',
required: true,
@@ -27,6 +32,12 @@ export const mailSendTool: ToolConfig<MailSendParams, MailSendResult> = {
visibility: 'user-or-llm',
description: 'Email body content',
},
resendApiKey: {
type: 'string',
required: true,
visibility: 'user-only',
description: 'Resend API key for sending emails',
},
},
request: {
@@ -36,6 +47,8 @@ export const mailSendTool: ToolConfig<MailSendParams, MailSendResult> = {
'Content-Type': 'application/json',
}),
body: (params: MailSendParams) => ({
resendApiKey: params.resendApiKey,
fromAddress: params.fromAddress,
to: params.to,
subject: params.subject,
body: params.body,

View File

@@ -1,6 +1,8 @@
import type { ToolResponse } from '@/tools/types'
export interface MailSendParams {
resendApiKey: string
fromAddress: string
to: string
subject: string
body: string