Handling Emails

Learn how to build scalable Email applications using the Elarian customer engagement framework.

Sending

const customer = new client.Customer({
    number: 'YOUR-CUSTOMERS-EMAIL',
    provider: 'email'
});

const resp = await customer.sendMessage(
  {
    number: 'YOUR-BUSINESS-EMAIL',
    channel: 'email'
  },
  {
    body: {
      email: {
        subject: 'Hi',
        bodyPlain: 'Hello World!'
      }
    }
  }
);

Receiving

client.on('receivedEmail', (notification, customer, appData, callback) => {
  console.log(notification);
});