Twilio SendGrid ACTION
Send Email Multiple Recipients
This action sends a personalized e-mail to multiple specified recipients. See the docs here
- Action
- Writes data
- API key
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's Twilio SendGrid account once, then configure and run Send Email Multiple Recipients from your backend or agent.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "sendgrid-send-email-multiple-recipients",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
sendgrid: { authProvisionId: "apn_xxxxxxx" },
personalizations: "Personalizations",
toEmails: ["Recipient Emails"],
},
})
console.log(result)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "sendgrid-send-email-multiple-recipients",
"configured_props": {
"sendgrid": { "authProvisionId": "apn_xxxxxxx" },
"personalizations": "Personalizations",
"toEmails": ["Recipient Emails"]
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "sendgrid",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
name: "sendgrid-send-email-multiple-recipients",
arguments: {
personalizations: "Personalizations",
toEmails: ["Recipient Emails"],
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| Property | Type | Description |
|---|---|---|
personalizations Personalizations | string | An array of messages and their metadata. Each object within personalizations can be thought of as an envelope - it defines who should receive an individual message and how that message should be handled. See our Personalizations documentation for details. maxItems: 1000. Example: [{to:[{email:"email@email.com",name:"Example"}],subject:"Mail Personalization Sample"}] Optional |
toEmails Recipient Emails | string[] | The intended recipients' email addresses. Will be ignored if personalizations prop is used. Optional |
fromEmail From Email | string | The 'From' email address used to deliver the message. This address should be a verified sender in your Twilio SendGrid account. Required Dynamic |
fromName From Name | string | A name or title associated with the sending email address Optional |
dynamicTemplateData Dynamic Template Data | object | Dynamic template data is available using Handlebars syntax in Dynamic Transactional Templates. This field should be used in combination with a Dynamic Transactional Template, which can be identified by a template_id starting with d-. This field is a collection of key/value pairs following the pattern "variable_name":"value to insert" Optional |
templateId Template ID | string | An email template ID. A template that contains a subject and content — either text or html — will override any subject and content values specified at the personalizations or message level. Optional Dynamic |
replyToEmail Reply To Email | string | The email address where any replies or bounces will be returned Optional |
replyToName Reply To Name | string | A name or title associated with the replyToEmail address Optional |
subject Subject | string | The global or message level subject of your email. This may be overridden by subject lines set -in personalizations. Required |
content Content | string | Content of the email in text/html Optional |
headers Headers | object | An object containing key/value pairs of header names and the value to substitute for them. The key/value pairs must be strings. You must ensure these are properly encoded if they contain unicode characters. These headers cannot be one of the reserved headers. Optional |
categories Categories | string[] | A string array of category names for this message. Each category name may not exceed 255 characters. Example: ["category1","category2"] Optional |
customArgs Custom Args | string | Values that are specific to the entire send that will be carried along with the email and its activity data. Key/value pairs must be strings. Substitutions will not be made on custom arguments, so any string that is entered into this parameter will be assumed to be the custom argument that you would like to be used. This parameter is overridden by custom_args set at the personalizations level. Total custom_args size may not exceed 10,000 bytes. Optional |
sendAt Send At | integer | An ISO 8601 formatted date-time (YYYY-MM-DDTHH:MM:SSZ) allowing you to specify when you want your email to be delivered. This may be overridden by the send_at parameter set at the personalizations level. Delivery cannot be scheduled more than 72 hours in advance. If you have the flexibility, it's better to schedule mail for off-peak times. Most emails are scheduled and sent at the top of the hour or half hour. Scheduling email to avoid peak times — for example, scheduling at 10:53 — can result in lower deferral rates due to the reduced traffic during off-peak times. Optional |
asm ASM | object | Advanced Suppression Manager. An object allowing you to specify how to handle unsubscribes Optional |
asmGroupId ASM Group ID | integer | Advanced Suppression Manager Group ID. The unsubscribe group to associate with this email. Will override the value set in the asm param if also set Optional Dynamic |
asmGroupsToDisplay ASM Groups to Display | integer[] | An array containing the unsubscribe groups that you would like to be displayed on the unsubscribe preferences page. Will override the value set in the asm param if also set. Requires asmGroupId set if this is set Optional Dynamic |
ipPoolName IP Pool Name | string | The IP Pool that you would like to send this email from Optional |
mailSettings Mail Settings | object | A collection of different mail settings that you can use to specify how you would like this email to be handled Optional |
trackingSettings Tracking Settings | object | Settings to determine how you would like to track the metrics of how your recipients interact with your email Optional |
numberOfAttachments Number Of Attachments | integer | The number of attachments to be sent with the email. Optional |
syncDir SyncDir | dir | Optional |
REFERENCE
Tool details
Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.
- Registry key
- sendgrid-send-email-multiple-recipients
- Version
- 0.1.2
- App
- Twilio SendGrid
- Authentication
- API key
- Read-only
- No
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗