Before continuing, make sure you’ve completed the SDK setup and requirements.

Overview

This guide walks you through how to send a transactional email using the Nuntly TypeScript SDK.

Send a HTML email

const email = await nuntly.emails.send({
  from: 'ray@info.tomlinson.ai',
  subject: 'Verify Your Email Address',
  to: 'brian67@gmail.com',
  html: `
    <h1>Welcome 🎉</h1>
    <p>Thank you for signing up! Please verify your email address...</p>
  `,
});

console.log(`Email sent ${email.id} 🎉`);

Send a Text email

const email = await nuntly.emails.send({
  from: 'ray@info.tomlinson.ai',
  subject: 'Verify Your Email Address',
  to: 'brian67@gmail.com',
  text: 'Thank you for signing up! Please verify your email address...',
});

console.log(`Email sent ${email.id} 🎉`);

Send both HTML and Text

const email = await nuntly.emails.send({
  from: 'ray@info.tomlinson.ai',
  subject: 'Verify Your Email Address',
  to: 'brian67@gmail.com',
  html: `
    <h1>Welcome 🎉</h1>
    <p>Thank you for signing up! Please verify your email address...</p>
  `,
  text: 'Thank you for signing up! Please verify your email address...',
});

console.log(`Email sent ${email.id} 🎉);