Browse Source

Merge branch 'feature/Redmine-17825-Email_Template' of http://202.166.220.79:3000/IME-LONDON/ThirdPartyAPI into feature/Redmine-17825-Email_Template

prod
Leeza Baidar 12 months ago
parent
commit
17866ffb1e
  1. 4
      Business/BusinessLogic/SMSApiService/SMSService.cs
  2. 23
      Business/BusinessLogic/SMSApiService/SmsResponse.cs
  3. 1
      Common/Models/Enums/GeneralEnum.cs
  4. 4
      ThirdPartyAPIs/Config/Mapping.json

4
Business/BusinessLogic/SMSApiService/SMSService.cs

@ -41,7 +41,7 @@ namespace Business.BusinessLogic.SMSApiService
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
byte[] buf = new byte[1024]; byte[] buf = new byte[1024];
string url = _baseUrl + string url = _baseUrl +
"?username=" + _userName + "&password=" + _password + "&option=xml" +
"?username=" + _userName + "&password=" + _password +
"&number=" + model.MobileNumber + "&message=" + HttpUtility.UrlEncode(model.SMSBody) + "&number=" + model.MobileNumber + "&message=" + HttpUtility.UrlEncode(model.SMSBody) +
"&orig=" + HttpUtility.UrlEncode(_senderId); "&orig=" + HttpUtility.UrlEncode(_senderId);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
@ -62,7 +62,7 @@ namespace Business.BusinessLogic.SMSApiService
var result = sb.ToString(); var result = sb.ToString();
if (result.Contains("SUCCESS 722"))
if (result.Contains("SUCCESS"))
{ {
_tPResponse.ResponseCode = "0"; _tPResponse.ResponseCode = "0";
_tPResponse.Msg = "SMS Sent Successfully!"; _tPResponse.Msg = "SMS Sent Successfully!";

23
Business/BusinessLogic/SMSApiService/SmsResponse.cs

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace Business.BusinessLogic.SMSApiService
{
[XmlRoot(ElementName = "response")]
public class SmsResponse
{
[XmlElement(ElementName = "credits")]
public string Credits { get; set; }
[XmlElement(ElementName = "credits_used")]
public string Credits_used { get; set; }
[XmlAttribute(AttributeName = "status")]
public string Status { get; set; }
[XmlAttribute(AttributeName = "id")]
public string Id { get; set; }
}
}

1
Common/Models/Enums/GeneralEnum.cs

@ -54,6 +54,7 @@ namespace Common.Models.Enums
[Description("Email to customer for OTP")] [Description("Email to customer for OTP")]
OTP_EMAIL = 8, OTP_EMAIL = 8,
FORCE_PASSWORD_CHANGE = 9,
TRANSACTION_APPROVED = 10, TRANSACTION_APPROVED = 10,
TRANSACTION_MODIFY = 11, TRANSACTION_MODIFY = 11,

4
ThirdPartyAPIs/Config/Mapping.json

@ -25,7 +25,7 @@
{ {
"SValue": "OTP_EMAIL", "SValue": "OTP_EMAIL",
"DValue": "App_Data\\Templates\\OTP_EMAIL.html", "DValue": "App_Data\\Templates\\OTP_EMAIL.html",
"Dtext": "IME Verification"
"Dtext": "IME London Verification"
}, },
{ {
"SValue": "BANK_TXN_POST", "SValue": "BANK_TXN_POST",
@ -58,7 +58,7 @@
"Dtext": "Registration Completion Email" "Dtext": "Registration Completion Email"
}, },
{ {
"SValue": "RESET_PASSWORD",
"SValue": "RESET_PASSWORD_EMAIL",
"DValue": "App_Data\\Templates\\RESET_PASSWORD_EMAIL.html", "DValue": "App_Data\\Templates\\RESET_PASSWORD_EMAIL.html",
"Dtext": "Reset Password" "Dtext": "Reset Password"
} }

Loading…
Cancel
Save