notifme / notifme-sdk

A Node.js library to send all kinds of transactional notifications.

Home Page:https://notifme.github.io/www/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

api to add new vendor

HarshaHegde1994 opened this issue · comments

Hi, please give us an API to add new vendors for SMS and mail integration.

Hi,

You can add custom provider if you want, you just have to implement the send function which returns a Promise. See Custom in the documentation

example with email :

new NotifmeSdk({
  channels: {
    email: {
      providers: [{
        type: 'custom',
        id: 'my-custom-email-provider...',
        send: async (request) => {
          // Send email
          return 'id...'
        }
      }]
    }
  }
})

@HarshaHegde1994 I hope this answered your question. You can reopen this issue if you want more precisions.

Thanks for the reply. can you be more specific for the request and what should that function hold?

request is one of the following types: https://github.com/notifme/notifme-sdk/blob/master/src/models/notification-request.js

And send should call your provider API: something like https://github.com/notifme/notifme-sdk/blob/master/src/providers/sms/46elks.js#L21-L42

What provider(s) do you want to use?

Thanks for the help @BDav24. I'm using a local service provider for sending SMS.