FM_Communications
Overview
Custom module for Joey's
Installation & Configuration
Installation
Installing this module will create the following DB tables:
- fm_communication_settings
- fm_communication_emails_sent
- fm_communication_sms_sent
- fm_communication_types
- fm_communication_phone_numbers
- fm_communication_emails
And populating the following:
- fm_communication_settings (mailgun_domain, mailgun_public_api_key, mailgun_api_key, twilio_sid, twilio_auth_token, twilio_phone_number)
- fm_communication_types (Home, Work, Mobile)
- fm_communication_emails based on the user_details "Email".
- Communication type is set to "Work" (ID 6) as default.
- The data will be added if:
- user detail fields "First Name" and "Last Name" exist;
- the values for user detail fields "First Name" and "Last Name" are not blank
- fm_communication_phone_numbers based on user_details "Phone Number".
- Communication type is set to "Work" (ID 6) as default.
- Character such as ".", ")", "(", "-" will be omitted from raw phone number input. Will add 1 to the raw phone number input if there is less than 10 digits
- The data will be added if:
- user detail fields "First Name" and "Last Name" exist;
- the values for user detail fields "First Name" and "Last Name" are not blank
Configuration
N/A
Usage
Set all inactive if the user has been deactivated / deleted
set name if the user's Name has changed
edit_email, edit_phone_number
Validate email / phone number via Mailgun and Trellio respectively. Note that there will be charge ($$$) for every validation.
Rest APIs
/includes/modules/FM_Communication/api/communication_settings
Type: GET
Description: retrieve data in JSON format from fm_communication_emails and fm_communication_phone_numbers based on current user
Sample Output:
{"emails":[{"item_id":7330,"value":"blep@icomproductions.ca","type":"Work","isValid":true,"use":true}],"phone_numbers":[{"item_id":5357,"value":"14032491234","type":"Work","isValid":true,"use":true}]}
/includes/modules/FM_Communication/api/communication_settings/email
Type: POST
Parameters:
- item_id
- value
- first_name
- last_name
- type
- use
Description: edit email for current user
/includes/modules/FM_Communication/api/communication_settings/phone_number
Type: POST
Parameters:
- item_id
- value
- first_name
- last_name
- type
- use
Description: edit phone number for current user
/includes/modules/FM_Communication/api/communication_settings/delete_email
Type: POST
Parameter: item_id
Description: delete email
/includes/modules/FM_Communication/api/communication_settings/delete_phone_number
Type: POST
Parameter: item_id
Description: delete phone number
/includes/modules/FM_Communication/api/delivery_success
Type: POST
Description: verify Mailgun
/includes/modules/FM_Communication/api/delivery_failure
Type: POST
Description" verify mailgun???
/includes/modules/FM_Communication/api/sms_delivery
Type: POST
Description" verify trilio
Limitation
N/A
FAQ / Troubleshooting
N/A