Exemple #1
0
 /// <summary>
 /// Enum types are equal by primary key
 /// </summary>
 public bool Equals(SupportRequestType other)
 {
     if (other == null)
     {
         return(false);
     }
     return(other.SupportRequestTypeID == SupportRequestTypeID);
 }
        public void SendMessage(string ipAddress, string userAgent, string currentUrl, SupportRequestType supportRequestType)
        {
            var subject = $"Support Request for Neptune - {DateTime.Now.ToStringDateTime()}";
            var message = string.Format(@"
<div style='font-size: 12px; font-family: Arial'>
    <strong>{0}</strong><br />
    <br />
    <strong>From:</strong> {1} - {2}<br />
    <strong>Email:</strong> {3}<br />
    <strong>Phone:</strong> {4}<br />
    <br />
    <strong>Subject:</strong> {5}<br />
    <br />
    <strong>Description:</strong><br />
    {6}
    <br />
    <br />
    <br />
    <div style='font-size: 10px; color: gray'>
    OTHER DETAILS:<br />
    LOGIN: {7}<br />
    IP ADDRESS: {8}<br />
    USERAGENT: {9}<br />
    URL FROM: {10}<br />
    <br />
    </div>
    <div>You received this email because you are set up as a point of contact for support - if that's not correct, let us know: {11}</div>.
</div>
",
                                        subject,
                                        RequestPersonName,
                                        RequestPersonOrganization ?? "(not provided)",
                                        RequestPersonEmail,
                                        RequestPersonPhone ?? "(not provided)",
                                        supportRequestType.SupportRequestTypeDisplayName,
                                        RequestDescription.HtmlEncodeWithBreaks(),
                                        RequestPerson != null ? $"{RequestPerson.GetFullNameFirstLast()} (UserID {RequestPerson.PersonID})" : "(anonymous user)",
                                        ipAddress,
                                        userAgent,
                                        currentUrl,
                                        Common.NeptuneWebConfiguration.SitkaSupportEmail);
            // Create Notification
            var mailMessage = new MailMessage {
                From = new MailAddress(Common.NeptuneWebConfiguration.DoNotReplyEmail), Subject = subject, Body = message, IsBodyHtml = true
            };

            // Reply-To Header
            mailMessage.ReplyToList.Add(RequestPersonEmail);

            // TO field
            SupportRequestType.SetEmailRecipientsOfSupportRequest(mailMessage);

            SitkaSmtpClient.Send(mailMessage);
        }
Exemple #3
0
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static SupportRequestLog CreateNewBlank(SupportRequestType supportRequestType)
 {
     return(new SupportRequestLog(default(DateTime), default(string), default(string), supportRequestType, default(string)));
 }
Exemple #4
0
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public SupportRequestLog(DateTime requestDate, string requestPersonName, string requestPersonEmail, SupportRequestType supportRequestType, string requestDescription) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.SupportRequestLogID  = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.RequestDate          = requestDate;
     this.RequestPersonName    = requestPersonName;
     this.RequestPersonEmail   = requestPersonEmail;
     this.SupportRequestTypeID = supportRequestType.SupportRequestTypeID;
     this.RequestDescription   = requestDescription;
 }