Kassel Labs Mail Server API
This is a client made to make Kassel Labs mailing system easier
How to Use
First you need to initialize your client with your credentials
const MailServerApi = require('@kassellabs/mail-server-api');
const mailApi = MailServerApi({
url: '<the url from your broker goes here>',
});
Then you're ready to send e-mails
Sending Common HTML or Text e-mails
To send e-mails, you can use the basic mailing API
mailApi.sendEmail({
from: 'foo@kassellabs.io',
to: 'foo@gmail.com'
replyTo: 'no-reply@kassellabs.io',
subject: 'Just wanna say Hi',
html: '<div>Hi</div>',
text: 'Hi',
});
Sending Template E-mails
Sending template e-mails will enable you to send templates e-mails that are
already included on the mail-server
, check its code to see them.
mailApi.sendTemplateEmail({
template: 'video-is-ready'
to: 'foo@gmail.com',
replyTo: 'no-reply@kassellabs.io',
context: {
name: 'John Doe',
code: 'JHND',
...
},
});