Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 1.79 KB

File metadata and controls

51 lines (36 loc) · 1.79 KB
code type title description order
false
page
Overview
Overview of the Hermes Messenger plugin features and main concepts
100

Hermes Messenger

This plugin gives the application the ability to send various types of messages (SMS, email) using external providers.

Available providers SMS providers:

  • Twilio

Available email providers:

  • Sendgrid
  • SMTP

Accounts Management

It is possible to register differents accounts for each provider. Then API actions used to send messages can be used with different accounts.

In this way, several accounts with differents credentials can be used to send messages.

The following API actions can be used to manipulate accounts for each providers:

Register an account at startup

Accounts can be setup programmaticaly after the application has started by using the addAccount method.

Clients are available from getters on the plugin instance.

app.start()
  .then(() => {
    // Add a "common" Twilio account
    hermesMessengerPlugin.clients.twilio.addAccount('common', 'accountSid', 'authToken', '+33629951621');

    // Add a "common" Sendgrid account
    hermesMessengerPlugin.clients.sendgrid.addAccount('common', 'apiKey', 'amaret@kuzzle.io');

    // Add a "common" SMTP account
    hermesMessengerPlugin.clients.smtp.addAccount('common', 'smtp.example.com', 587, 'dummyUser', 'dummyPass', 'amaret@kuzzle.io');
  })
  .catch(console.error);