Superface logo

Send Email

Version: 2.0.1
communication/send-email
superface

Send transactional email.

Send Email

Send transactional email to one recipient. Email can contain text and/or html representation.

From
To
Subject
Text
HTML
Message Identifier

1. Install

npx @superfaceai/cli install communication/send-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-email');

  // Use the profile
  const result = await profile
    .getUseCase('SendEmail')
    .perform({
      from: '[email protected]',
      to: '[email protected]',
      subject: 'Your order has been shipped!',
      text: 'Hello Jane, your recent order on Our Shop has been shipped.'
    });

  return result.unwrap();
}

run();

3. Add providers