Details
-
Type: Sub-task
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.2.0
-
Fix Version/s: 4.2.0
-
Component/s: None
-
Labels:None
Description
We would need a table to add different sms providers and their credentials.
Assumption: there could be multiple numbers / accounts / api-types from same provider
Adding a new option group for sms provider name (to store provider names eg : Clickatell )
Table 1: civicrm_sms_provider with following columns:
name (provider's internal name - FK to value of this new option group) - varchar(64)
title (provider's name visible to user) - varchar(64)
username - varchar(255)
password - varchar(255)
api_type (http / xml / smtp .. FK to value of this new option group)
api_url (example - http://api.clickatell.com/http/sendmsg, http://api.clickatell.com/xml/xml, sms@messaging.clickatell.com)
api_params (example:
HTTP:
user=testuser
password=<Clickatell Account Password>
api_id=3364258
to=<Mobile Number>
text=<SMS Message>
XML:
<api_id>3364259</api_id>
<user>testuser</user>
<password>PASSWORD</password>
<to>Mobile Number</to>
<text>SMS Message</text>
SMTP:
user:testuser
password:<Clickatell Account Password>
api_id:3364266
text:<SMS Message>
to:<Mobile Number 1>
to:<Mobile Number 2> ..
)
notify (number to notify) - varchar(32)
is_default - tinyint(4)
is_active - tinyint(4)
Text in api_params should be allowed to be replaced also via hooks.
For now we would just update the activity for status returned from callback. So we won't add any additional table. Hooks should allow using additional tables and storing / keeping track of additional values.
Add a new column 'sms_provider_id' to existing civicrm_mailing table which would be FK to civicrm_sms_provider.id.
Add a new column 'phone_id' in civicrm_mailing_recipients and civicrm_mailing_event_queue table. This will help cron to be sms compatible.
Make civicrm_mailing_recipients.email_id and civicrm_mailing_event_queue.email_id accept NULL values, since there could be situations where contacts only have phone and no email.