Using the Nexmo API to make SMS message with specific phone number and user.
- Set up a Nexmo account on Nexmo developer site
- Creating
phone.csvand locate this CSV file is withemask-notifier.shon same directory.
And the format is as follows:
user_name,user_phone
- Set
api_keyas a system environment variable withecho 'export api_key="{your_api_key}"' | sudo tee -a /etc/environmenton/etc/environmentfile - Set
api_secretas a system environment variable withecho 'export api_secret="{your_api_secret}"' | sudo tee -a /etc/environmenton/etc/environmentfile - Using
cd /path/to/emask-notifier/ && ./emask-notifier.shas a Cronjob to let this Bash script do work automatically. - Done. Happy to do notification for your friends :)!
- Remove
api_keysystem environment variable on/etc/environmentfile - Remove
api_secretsystem environment variable on/etc/environmentfile - Remove this Cronjob work.
- Checking the
supervisor,curlandcroncommands have been available on deployed operating system. PHP 7.4has been installed on Ubuntu operating system.- Download
composer.pharwithcurl -sS https://getcomposer.org/installer | php7.4command. - Running
php composer.phar update -ncommand. - Creating the
.envto setup theVONAGE_API_KEY,VONAGE_API_SECRET,SENDER_EMAIL,RECIPIENT_EMAIL,MJ_APIKEY_PUBLICandMJ_APIKEY_PRIVATEvariables. - Creating the
phone.csvto setup the user phone number lists. - Running the
notifier_php_builder.shscript to setup all of above works.
- We assume that this uninstallation work is running with non-root user.
- Stopping notifier worker with
sudo rm /etc/supervisor/conf.d/notifier-php.conf - Restarting supervisor service with
sudo systemctl restart supervisor - Removing this repository with
rm -rf /path/to/emask-notifier