private static string GenerateMessageUnknownGatewayResponse(SmsEmailJson smsEmailJson) { return($@"The SMS Gateway returned an unknown response. This requires manual investigation.<br /> <br /> <strong>The message details were</strong><br /> <pre> {JsonConvert.SerializeObject(smsEmailJson, Formatting.Indented)} </pre>"); }
private static string GenerateMessageMissingFields(SmsEmailJson smsEmailJson, List <string> missingFields) { return($@"The following mandatory fields were missing or invalid<br /> <ul> <li><strong>{string.Join($"</strong></li><br />{Environment.NewLine} <li><strong>", missingFields)}</strong></li><br /> </ul> <br /> <strong>The message details were</strong><br /> <pre> {JsonConvert.SerializeObject(smsEmailJson, Formatting.Indented)} </pre>"); }
private static string GetBestEmail(SmsEmailJson smsEmailJson) { if (!string.IsNullOrEmpty(smsEmailJson.AssignedToEmail)) { return(smsEmailJson.AssignedToEmail); } if (!string.IsNullOrEmpty(smsEmailJson.RepliesToEmail)) { return(smsEmailJson.RepliesToEmail); } return(_fallbackEmailFrom); }
private static string GenerateMessageGatewayError(Message message, SmsEmailJson smsEmailJson, SendSmsResponse sendSmsResponse) { var isHtml = message?.Body?.ContentType == BodyType.Html; return($@"The Konekta SMS gateway returned an error<br /> Gateway Error Code: <strong>{sendSmsResponse?.Error?.Code}</strong><br /> Gateway Error Description: <strong>{sendSmsResponse?.Error?.Description}</strong><br /> <br /> <strong>The message details were</strong><br /> <pre> {JsonConvert.SerializeObject(smsEmailJson, Formatting.Indented)} </pre><br /> <br /> <strong>Original Email</strong><br /> <hr> <strong>From: </strong>"{message.From?.EmailAddress?.Name}" <{message.From?.EmailAddress?.Address}><br /> <strong>Subject: </strong>{message?.Subject}<br /> {(isHtml ? "<pre>" : "")} {message?.Body?.Content} {(isHtml ? "</pre>" : "")}"); }
private static string GenerateTicketSubject(SmsEmailJson smsEmailJson) { return($"SMS Failure for org '{smsEmailJson.OrgKey}', matter '{smsEmailJson.Matter}', template '{smsEmailJson.Template}'"); }