fix: issue in mail sender.

This commit is contained in:
a.bouhuolia
2020-12-17 01:16:08 +02:00
parent 3ac6d8897e
commit 46d06bd591
32 changed files with 538 additions and 334 deletions

View File

@@ -12,7 +12,8 @@ export default class EasySMSClient implements SMSClientInterface {
*/
send(to: string, message: string) {
const API_KEY = config.easySMSGateway.api_key;
const params = `action=send-sms&api_key=${API_KEY}=&to=${to}&sms=${message}&unicode=1`;
const parsedTo = to.indexOf('218') === 0 ? to.replace('218', '') : to;
const params = `action=send-sms&api_key=${API_KEY}=&to=${parsedTo}&sms=${message}&unicode=1`;
return new Promise((resolve, reject) => {
axios.get(`https://easysms.devs.ly/sms/api?${params}`)

View File

@@ -8,7 +8,7 @@ export default class SMSAPI {
}
/**
*
* Sends the message to the target via the client.
* @param {string} to
* @param {string} message
* @param {array} extraParams