Send Templated Email

Version: 1.0.1
communication/send-templated-email
superface

Send templated transactional email to one recipient.

Send Templated Email

Send templated transactional email to one recipient. Requires template defined on provider side.

From
To
Template Identifier
Template Data
Message Identifier

1. Install

npx @superfaceai/cli install communication/send-templated-email

2. Use in your code

const { SuperfaceClient } = require('@superfaceai/one-sdk');

const sdk = new SuperfaceClient();

async function run() {
  // Load the installed profile
  const profile = await sdk.getProfile('communication/send-templated-email');

  // Use the profile
  const result = await profile
    .getUseCase('SendTemplatedEmail')
    .perform({
      from: 'no-reply@example.com',
      to: 'jane.doe@example.com',
      templateId: 'user-invitation',
      templateData: {
        invited_by: 'Bob',
        invitation_link: 'example.com/invite?code=invite'
      }
    });

  return result.unwrap();
}

run();

3. Add providers