const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fromEmail: 'founder@example.com',
to: [{email: 'ada@lovelace.dev', name: 'Ada'}],
subject: 'Quick intro',
htmlBody: '<p>Hi Ada — great meeting you!</p>'
})
};
fetch('https://www.dench.com/api/v1/email/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));