Send an email using Amazon SES
@dylburger
code:
data:privatelast updated:4 years ago
today
Build integrations remarkably fast!
You're viewing a public workflow template.
Sign up to customize, add steps, modify code and more.
Join 1,000,000+ developers using the Pipedream platform
steps.
trigger
HTTP API
Deploy to generate unique URL
This workflow runs on Pipedream's servers and is triggered by HTTP / Webhook requests.
steps.
send_an_email
Send an email using Amazon SES
auth
(auths.amazon_ses)
params
To Addresses

An array of email addresses you want to send email to

[0]:
 
array ·params.ToAddresses
Text

Plaintext email body

 
Test
string ·params.text
Subject

Email subject

 
Hello, World
string ·params.subject
From

The email from which the email is addressed

 
notifications@pipedream.com
string ·params.Source
Optional
code
async (params, auths) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
}
41
const AWS = require("aws-sdk")
const { accessKeyId, secretAccessKey } = auths.amazon_ses

const ses = new AWS.SES({
  accessKeyId, 
  secretAccessKey,
  region: 'us-east-1',
})

const { CcAddresses, BccAddresses, ToAddresses, html, text, subject, Source } = params
const sesParams = {
  Destination: {
    CcAddresses,
    BccAddresses,
    ToAddresses,
  }, 
  Message: {
    Body: {
      Text: {
        Charset: "UTF-8", 
        Data: text,
      }
    }, 
    Subject: {
      Charset: "UTF-8", 
      Data: subject,
    }
  },
  Source: "notifications@pipedream.com", 
};

if (html) {
  sesParams.Message.Body.Html = {
    Charset: "UTF-8", 
    Data: html,
  }
}

this.resp = await ses.sendEmail(sesParams).promise()