Back to Blog

Sending Custom Email

Cloud code actions provides functionality to send e-mails.

Example use cases:

You can send an email using the method.

Sending HTML

We support sending (limited) HTML formatted email with custom emails.

async payload => {{
    to: '[email protected]',
    message: '<div><h1>Example Title</h1><p>This is an HTML example</p></div>'

Sending data with e-mails

Cloud code supports JavaScript template tags that allows you to send information, like parameters inside the payload.

Sending an email with the name of a user

async payload => {{
    to: '[email protected]',
    message: `Some data extracted: ${}`

Sending an email with a param

async payload => {{
    to: '[email protected]',
    message: `Some data extracted: ${[0].value}`

Sending all parameters

Combining a custom formatted email with dynamic data:

async payload => {

  const {
  } = payload

  // Generate HTML for the params
  let paramsHtml = ''

  const paramNames = Object.keys(params)
  for (let i = 0; i < paramNames.length; i++) {

    const paramName = paramNames[i]

    // Get the param
    const param = params[paramName]

    // Add the param name to the HTML
    paramsHtml += `
        <div>${ => values.value).join(', ')}</div>
    to: '[email protected]',
    subject: `Collected ${paramNames.length} params`,
    message: `
    <h2>We found the following data!</h2>
    <p>This is just a small example</p>
Get StartedContact us