Exemple #1
0
        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>");
        }
Exemple #2
0
        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>");
        }
Exemple #3
0
        private static string GetBestEmail(SmsEmailJson smsEmailJson)
        {
            if (!string.IsNullOrEmpty(smsEmailJson.AssignedToEmail))
            {
                return(smsEmailJson.AssignedToEmail);
            }

            if (!string.IsNullOrEmpty(smsEmailJson.RepliesToEmail))
            {
                return(smsEmailJson.RepliesToEmail);
            }

            return(_fallbackEmailFrom);
        }
Exemple #4
0
        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>&quot;{message.From?.EmailAddress?.Name}&quot; &lt;{message.From?.EmailAddress?.Address}&gt;<br />
<strong>Subject: </strong>{message?.Subject}<br />
{(isHtml ? "<pre>" : "")}
{message?.Body?.Content}
{(isHtml ? "</pre>" : "")}");
        }
Exemple #5
0
 private static string GenerateTicketSubject(SmsEmailJson smsEmailJson)
 {
     return($"SMS Failure for org '{smsEmailJson.OrgKey}', matter '{smsEmailJson.Matter}', template '{smsEmailJson.Template}'");
 }