Created
December 22, 2017 09:24
-
-
Save raghavgarg1257/2ce8ae9353361c77858ea0225fc2e71e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sendOtp(mobiles, message = null) { | |
| const params = [ | |
| { key: 'authkey', value : process.env.SMS_API_KEY }, | |
| { key: 'sender', value : process.env.SMS_SENDERID }, | |
| { key: 'otp_length', value : 6 }, | |
| { key: 'message', value : message || encodeURIComponent("Your verification code for Spectrum is ##OTP##.") }, | |
| { key: 'mobile', value : mobiles } | |
| ]; | |
| const queryParams = params.map( o => `${o.key}=${o.value}` ); | |
| return axios.post(`http://control.msg91.com/api/sendotp.php?${queryParams.join('&')}`, params); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment