1.0.4 • Published 11 months ago

@thetribe/strapi-provider-sms-smsenvoi v1.0.4

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
github
Last release
11 months ago

strapi-provider-sms-smsenvoi

Note: this package needs to be used with a sms provider for Strapi, such as https://github.com/thetribeio/strapi-plugin-sms.

Credentials

Check smsenvoi authentication instruction to get user key and access token

Example

Path - config/plugins.js

module.exports = ({ env }) => ({
  // ...
  sms: {
    config: {
      provider: 'smsenvoi',
      providerOptions: {
        userKey: env('SMS_ENVOI_USER_KEY'),
        accessToken: env('SMS_ENVOI_ACCESS_TOKEN')
      },
      settings: {
        defaultSender: env('SMS_ENVOI_ACCESS_TOKEN', 'Strapi')
      },
    },
  },
  // ...
});

Check out the available options for smsenvoi: https://developers.smsenvoi.com/

Development mode

You can override the default configurations for specific environments. E.g. for NODE_ENV=development in config/env/development/plugins.js:

module.exports = ({ env }) => ({
  sms: {
    config: {
      provider: 'smsenvoi',
      providerOptions: {
        userKey: env('SMS_ENVOI_USER_KEY'),
        accessToken: env('SMS_ENVOI_ACCESS_TOKEN')
      },
      settings: {
        defaultSender: env('SMS_ENVOI_ACCESS_TOKEN', 'Strapi')
      },
    },
  },
});

Usage

To send an sms from anywhere inside Strapi:

await strapi.plugin('sms').service('sms').send({
  recipient: ['+33600000000'],
  sender: 'My Sender',
  message: 'Hello world',
  richURL: 'https://example.com'
});

The following fields are supported:

FieldDescription
senderName of the sender
recipientPhone numbers of the recipients
textPlaintext version of the message
richURLURL used to replace the %RICHURL____% placeholder
1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago