Skip to content

DaVinciLord/strapi-provider-sms-smsenvoi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

strapi-provider-sms-smsenvoi

Example

Path - config/plugins.js

module.exports = ({ env }) => ({
  // ...
  email: {
    config: {
      provider: 'smsenvoi',
      providerOptions: {
        userKey: env('SMS_ENVOI_USER_KEY'),
        accessToken: env('SMS_ENVOI_ACCESS_TOKEN')
      },
      settings: {
        defaultSender: '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 }) => ({
  email: {
    config: {
      provider: 'smsenvoi',
      providerOptions: {
        userKey: env('SMS_ENVOI_USER_KEY'),
        accessToken: env('SMS_ENVOI_ACCESS_TOKEN')
      },
      settings: {
        defaultSender: 'My Dev Env'
      },
    },
  },
});

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:

Field Description
sender Name of the sender
recipient Phone numbers of the recipients
text Plaintext version of the message
richURL URL used to replace the %RICHURL________% placeholder

About

SMSEnvoi provider for Strapi SMS Plugin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages