View as Markdown
Twilio SendGrid icon

Twilio SendGrid ACTION

Send Email Single Recipient

This action sends a personalized e-mail to the specified recipient. 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 Single Recipient 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-single-recipient",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    sendgrid: { authProvisionId: "apn_xxxxxxx" },
    fromEmail: "From Email",
    fromName: "From Name",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Send Email Single Recipient inputs
Property Type Description
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
toEmail To Email string
The intended recipient's email address
Required
toName To Name string
The intended recipient's name
Optional
cc CC string
An array of recipients who will receive a copy of your email. Each object in this array must contain the recipient's email address. Each object in the array may optionally contain the recipient's name. Alternatively, provide a string that will JSON.parse to an array of recipient objects. Example: [{"email":"email@example.com","name":"Example Recipient"}]
Optional
bcc BCC string
An array of recipients who will receive a blind copy of your email. Each object in this array must contain the recipient's email address. Each object in the array may optionally contain the recpient's name. Alternatively, provide a string that will JSON.parse to an array of recipient objects. Example: [{"email":"email@example.com","name":"Example Recipient"}]
Optional
personalizationHeaders Personalization.Headers object
An object containing key/value pairs allowing you to specify handling instructions for your email. You may not overwrite the following headers: x-sg-id, x-sg-eid, received, dkim-signature, Content-Type, Content-Transfer-Encoding, To, From, Subject, Reply-To, CC, BCC.
Optional
substitutions Substitutions string
Substitutions allow you to insert data without using Dynamic Transactional Templates. This field should not 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 "substitution_tag":"value to substitute". The key/value pairs must be strings. These substitutions will apply to the text and html content of the body of your email, in addition to the subject and reply-to parameters. The total collective size of your substitutions may not exceed 10,000 bytes per personalization object.
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
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-single-recipient
Version
0.1.2
App
Twilio SendGrid
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes