Send new user signups to Slack, email
@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 800,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.
get_first_name
auth
to use OAuth tokens and API keys in code via theauths object
code
Write any Node.jscodeand use anynpm package. You can alsoexport datafor use in later steps via return or this.key = 'value', pass input data to your code viaparams, and maintain state across executions with$checkpoint.
async (event, steps) => {
1
2
3
4
}
5
console.log(event.body.name)

this.firstName = event.body.name.split(/\s+/)[0]
steps.
check_users_processed_so_far
auth
to use OAuth tokens and API keys in code via theauths object
code
Write any Node.jscodeand use anynpm package. You can alsoexport datafor use in later steps via return or this.key = 'value', pass input data to your code viaparams, and maintain state across executions with$checkpoint.
async (event, steps) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
}
17
const _ = require("lodash")

const { name } = event.body

const users = _.get($checkpoint, 'users', [])

if (_.includes(users, name)) {
  $end(`Already sent message for ${name}. Exiting`)
}

users.push(name)

$checkpoint = {
  users
}
steps.
email_me
Customize and send an email to the email address you registered with Pipedream. The email will be sent by notifications@pipedream.com.
params
Subject
 
string ·params.subject
Text
 
string ·params.text
Optional
code
async params => {
1
2
3
4
5
6
7
8
9
}
10
const options = {
  subject: params.subject,
  text: params.text,
}
if (params.html) {
  options.html = params.html
}
$send.email(options)
steps.
chat_post_message
Sends a message to a channel.
auth
(auths.slack)
params
Channel

Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See below for more details.

 
C1234567890
string ·params.channel
Text

Text of the message to send. See below for an explanation of formatting. This field is usually required, unless you're providing only attachments instead. Provide no more than 40,000 characters or risk truncation.

 
Hello world
string ·params.text
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
const data = {
  channel: params.channel,
  text: params.text,
  as_user: params.as_user,
  attachments: params.attachments,
  blocks: params.blocks,
  icon_emoji: params.icon_emoji,
  icon_url: params.icon_url,
  link_names: params.link_names,
  mrkdwn: params.mrkdwn,
  parse: params.parse,
  reply_broadcast: params.reply_broadcast,
  thread_ts: params.thread_ts,
  unfurl_links: params.unfurl_links,
  unfurl_media: params.unfurl_media,
  username: params.username,
}
const config = {
  method: "post",
  url: `https://slack.com/api/chat.postMessage`,
  headers: {
    Authorization: `Bearer ${auths.slack.oauth_access_token}`,
  },
  data,
}
return await require("@pipedreamhq/platform").axios(this, config)