예제 #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>");
        }
예제 #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>");
        }
예제 #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);
        }
예제 #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>" : "")}");
        }
예제 #5
0
 private static string GenerateTicketSubject(SmsEmailJson smsEmailJson)
 {
     return($"SMS Failure for org '{smsEmailJson.OrgKey}', matter '{smsEmailJson.Matter}', template '{smsEmailJson.Template}'");
 }