Browse Source

#17825 sms template changes

Mobile-pdf
Leeza Baidar 1 year ago
parent
commit
6c3c49862a
  1. 47
      Business/Mobile/MobileServices.cs
  2. 5
      Common/Model/Notification/SMSRequestModel.cs
  3. 2
      Repository/Mobile/MobileServicesRepo.cs

47
Business/Mobile/MobileServices.cs

@ -198,11 +198,14 @@ namespace Business.Mobile
{ {
string ProcessId = Guid.NewGuid().ToString().Replace("-", "") + ":sendSms"; string ProcessId = Guid.NewGuid().ToString().Replace("-", "") + ":sendSms";
SendSMSApiService _sendAPI = new SendSMSApiService(); SendSMSApiService _sendAPI = new SendSMSApiService();
string mobileNum = jsonRx.Extra2;
var mobNum = getSenderFormattedNumber(mobileNum);
SMSRequestModel _req = new SMSRequestModel SMSRequestModel _req = new SMSRequestModel
{ {
ProviderId = "onewaysms", ProviderId = "onewaysms",
MobileNumber =jsonRx.Extra2,
SMSBody = Common.Model.Enum.NotifyTemplate.OTP_EMAIL.ToString(),
MobileNumber = mobNum, //jsonRx.Extra2,
SMSBody = Common.Model.Enum.NotifyTemplate.OTP_EMAIL,
ProcessId = ProcessId.Substring(ProcessId.Length - 40, 40), ProcessId = ProcessId.Substring(ProcessId.Length - 40, 40),
RequestedBy = requestOTPModel.userId, RequestedBy = requestOTPModel.userId,
UserName = requestOTPModel.userId, UserName = requestOTPModel.userId,
@ -246,7 +249,44 @@ namespace Business.Mobile
} }
private string getSenderFormattedNumber(string number)
{
string finalNo = number;
if (!number.Contains("+44"))
{
string mobileFirst = number.Substring(0, 1);
if (mobileFirst == "0")
{
if (number.Length == 11)
{
finalNo = "+44" + number.Substring(1, number.Length - 1);
return finalNo;
}
else if (number.Length < 11)
{
finalNo = $"+44{number}";
}
}
else if (number.Substring(0, 1) != "0" && number.Length == 10)
{
finalNo = $"+44{number}";
}
}
else if (number.Contains("+44"))
{
string MobN = number.Substring(4, 1);
if (MobN == "0" && number.Length > 14)
{
finalNo = number.Remove(4, 1);
}
}
if (!finalNo.Substring(0, 1).Contains("+"))
finalNo = $"+{finalNo}";
return finalNo;
}
public JsonRxResponse VerifyIdNumber(IDValidateModel iDValidate) public JsonRxResponse VerifyIdNumber(IDValidateModel iDValidate)
{ {
@ -2006,12 +2046,13 @@ namespace Business.Mobile
string ProcessId = Guid.NewGuid().ToString().Replace("-", "") + ":sendSms"; string ProcessId = Guid.NewGuid().ToString().Replace("-", "") + ":sendSms";
SendSMSApiService _sendAPI = new SendSMSApiService(); SendSMSApiService _sendAPI = new SendSMSApiService();
//GetSMSTextForTxn //GetSMSTextForTxn
SMSRequestModel _req = new SMSRequestModel SMSRequestModel _req = new SMSRequestModel
{ {
ProviderId = "onewaysms", ProviderId = "onewaysms",
MobileNumber = pwdReset.mobileNo, MobileNumber = pwdReset.mobileNo,
SMSBody = Common.Model.Enum.NotifyTemplate.RESET_PASSWORD_EMAIL.ToString(),
SMSBody = Common.Model.Enum.NotifyTemplate.RESET_PASSWORD_EMAIL,
ProcessId = ProcessId.Substring(ProcessId.Length - 40, 40), ProcessId = ProcessId.Substring(ProcessId.Length - 40, 40),
RequestedBy = pwdReset.Username, RequestedBy = pwdReset.Username,
UserName = pwdReset.Username, UserName = pwdReset.Username,

5
Common/Model/Notification/SMSRequestModel.cs

@ -1,4 +1,5 @@
using System;
using Common.Model.Enum;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -12,7 +13,7 @@ namespace Common.Model.Notification
public string UserName { get; set; } public string UserName { get; set; }
public string RequestedBy { get; set; } public string RequestedBy { get; set; }
public string MobileNumber { get; set; } public string MobileNumber { get; set; }
public string SMSBody { get; set; }
public NotifyTemplate SMSBody { get; set; }
public string method { get; set; } public string method { get; set; }
public string ProviderId { get; set; } public string ProviderId { get; set; }
public string ControlNo { get; set; } public string ControlNo { get; set; }

2
Repository/Mobile/MobileServicesRepo.cs

@ -1513,7 +1513,7 @@ namespace Repository.Mobile
} }
var map = Utilities.GetLanguageMapping(enumString, lang); var map = Utilities.GetLanguageMapping(enumString, lang);
return new JsonRxResponse { ErrorCode = res.ResponseCode.Equals("0") ? "0" : "1", Msg = res.ResponseCode.Equals("3") ? map.Message.Replace("@username", res.Extra) : map.Message, Id = pwdReset.Username, Extra = res.Extra, Extra2 = res.Extra2 };
return new JsonRxResponse { ErrorCode = res.ResponseCode.Equals("0") ? "0" : "1", Msg = res.ResponseCode.Equals("3") ? map.Message.Replace("@username", res.Extra) : map.Message, Id = pwdReset.Username, Extra = res.Extra, Extra2 = res.Extra2, Extra3 = res.Extra3 };
} }
public JsonRxResponse RefreshCustomerInformation(UserModel user) public JsonRxResponse RefreshCustomerInformation(UserModel user)

Loading…
Cancel
Save