View as Markdown
Selzy icon

Selzy ACTION

Create Email Message

Adds a new email message. See the documentation
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Selzy account once, then configure and run Create Email Message 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: "selzy-create-email-message",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    selzy: { authProvisionId: "apn_xxxxxxx" },
    senderName: "Sender's name",
    senderEmail: "Sender's email address",
  },
})

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.

Create Email Message inputs
Property Type Description
senderName Sender's name string
It is a string that does not match the email address (the sender_email argument).
Required
senderEmail Sender's email address string
This email must be checked (to do this, you need to manually create at least one email with this return address via the web interface, then click on the "send the confirmation request" link and follow the link from the email).
Required
subject Subject string
String with the letter subject. It may include substitution fields. If you wish to use substitution fields, specify a string within a Pipedream Custom Expression and escape the curly brackets with a backslash. For example: {{ "Welcome to Our Newsletter, \{\{Name\}\}!" }}. The parameter is optional if Template Id is indicated.
Required
body Body string
HTML body of the letter. It may include substitution fields. If you wish to use substitution fields, specify an HTML string within a Pipedream Custom Expression and escape the curly brackets with a backslash. For example: {{ "<p>Hello \{\{Name\}\},</p><p>Here is your update.</p>" }}.
Required
listId List ID string
Code of the list on which the mailing will be sent.
Required Dynamic
textBody Text Body string
Text body of the letter. It may include substitution fields. If you wish to use substitution fields, specify a text string within a Pipedream Custom Expression and escape the curly brackets with a backslash. For example: {{ "Hello \{\{Name\}\},\nHere is your update." }}.
Optional
generateText Generate Text boolean
True means that the text part of the letter will be generated automatically based on the HTML part. If you do not provide the text version along with the HTML version, you are recommended to set the Generate Text parameter to true for automatic generation of the text part of the letter. If the text variant of the letter is provided using the Text Body parameter, the Generate Text parameter is ignored. Thus, if the Generate Text value has been set to true, the server's response will contain a warning.
Required
rawBody Raw Body string
It is intended to save the json structure of the block editor data structure (if the value is Message Format = block) The parameter obtains only the JSON structure, otherwise it will not be transferred.
Optional
messageFormat Message Format string

It defines the manner of creating a letter.

1 - If you transfer the text value in this parameter and both the body and Text Body parameters are filled, the body parameter will be ignored, and the letter will be created from the data, transferred in the Text Body parameter.

2 - If you transfer the block value in this parameter but do not specify Raw Body, the letter will be saved as Raw HTML.

3 - If you transfer the block value in this parameter, the body and Raw Body parameters must be transferred so taht you can save the message in the block editor format.

Optional
lang Lang string
Two-letter language code for the string with the unsubscribe link that is added to each letter automatically. If it is not specified, the language code from the API URL is used. In addition to the string with the unsubscribe link, this language also affects the interface of the unsubscribe page. Languages en, it, ua and ru are fully supported, and in case of some other languages (da, de, es, fr, nl, pl, pt, tr), the string with a link will be translated, and the control interface will be in English.
Optional
templateId Template Id string
ID of the user letter template created before, on the basis of which a letter can be created. If you have transferred this parameter, you may skip the mandatory Subject, Body, as well as Text Body and Lang parameters. These values will be taken from the corresponding parameters of the template the id of which was specified. If any of the above parameters is still transferred, the system will ignore the parameter that is taken from the template parameters, and the parameter explicitly transferred in this method will be used.
Optional Dynamic
systemTemplateId System Template Id string
ID of the system letter template created before, on the basis of which a letter can be created. If you have transferred this parameter, you may skip the mandatory Subject, Body, as well as Text Body and Lang parameters. These values will be taken from the corresponding parameters of the template the id of which was specified. If any of the above parameters is still transferred, the system will ignore the parameter that is taken from the template parameters, and the parameter explicitly transferred in this method will be used. If none of the Template Id or System Template Id parameters is specified, templates will not be used to create the letter.
Optional Dynamic
wrapType Wrap Type string
Alignment of the message text on the specified side. If the argument is missing, the text will not be aligned.
Optional
categories Categories string[]
A list of letter categories.
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
selzy-create-email-message
Version
0.0.3
App
Selzy
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes