SMS.ru integration for Drupal

Categories

Component ID

2877577

Component name

SMS.ru integration for Drupal

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

Very basic implementation of SMS.ru API for Drupal with Rules integration.

For now only implemented method is - send/sms. If you need another, you can make it by yourself ;)

Install

  • Download, extract and place it as all modules. Better to place this module to /sites/all/modules/custom.
  • Navigate to modules page and enable it.
  • Go to settings (admin/config/services/smsru) and set API key.

Settings

Attention! All numbers must be in worldwide format, without leading + and regional number. F.e. correct number for Russia is starts from +7 or 7, not 8 +8.

// @TODO helper function for supported countries (https://sms.ru/?panel=price&machine=1)

If you familiar with coding, you can use my regex for Russian numbers.

^+?s?7s?(?-?(?# code)[0-9]{3}(?# next 3 digit)s?)?-?s?[0-9]{3}s?-?(?# next 2 digits)[0-9]{2}s?-?(?# the last 2 digits)[0-9]{2}

Rules

  1. Create any condition you want.
  2. All available SMS.ru actions will be in SMS.RU group.
    Rules
  3. Fill required fields and save it.
  4. Enjoy.

Programmatically

smsru_class()->send_sms('79001234567', 'Hello World');