Learn how to send your first transactional email using the Nuntly API. Includes examples for HTML, plain text, and combined email messages.
const { data, error } = 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>`, }); if (error) { return console.error('Error sending email:', error); } console.log(`Email sent ${data.id} 🎉`);
const { data, error } = 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.', }); if (error) { return console.error('Error sending email:', error); } console.log(`Email sent ${data.id} 🎉`);
const { data, error } = 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...', }); if (error) { return console.error('Error sending email:', error); } console.log(`Email sent ${data.id} 🎉`);