diff --git a/back/methods/sms/send.js b/back/methods/sms/send.js index b4293151d7..69d89939a9 100644 --- a/back/methods/sms/send.js +++ b/back/methods/sms/send.js @@ -6,10 +6,11 @@ module.exports = Self => { Self.send = async(senderFk, destination, message, options) => { const smsConfig = await models.SmsConfig.findOne(); - if (destination.length == 9) { - const spainPrefix = '0034'; + const [{prefix: spainPrefix}] = await Self.rawSql( + 'SELECT prefix FROM pbx.prefix WHERE country = ?', ['es'], options + ); + if (destination.length == 9) destination = spainPrefix + destination; - } const params = { api_key: smsConfig.apiKey, @@ -34,7 +35,7 @@ module.exports = Self => { console.error(e); } if (!options?.insert) return; - // return response; + const [result] = response.result; const error = result.error_id; diff --git a/front/salix/components/recover-password/index.html b/front/salix/components/recover-password/index.html index 25b4aabd71..05ccedde38 100644 --- a/front/salix/components/recover-password/index.html +++ b/front/salix/components/recover-password/index.html @@ -30,8 +30,9 @@ val="email" ng-model="$ctrl.method" > - + + +
We will sent you a sms to recover your password diff --git a/modules/account/front/basic-data/index.html b/modules/account/front/basic-data/index.html index 605f915cc7..9464744338 100644 --- a/modules/account/front/basic-data/index.html +++ b/modules/account/front/basic-data/index.html @@ -28,10 +28,10 @@ rule="VnUser">