/// <summary>
 /// Returns unique hash for email instance. Send date would be converted to UTC using user timezone.
 /// </summary>
 /// <param name="sendDate">Email send date.</param>
 /// <param name="title">Email subject.</param>
 /// <param name="body">Email body.</param>
 /// <param name="timeZoneInfo">User timezone.</param>
 /// <param name="deleteWhiteSpaces">Flag, indicates if need to delete white spaces.</param>
 /// <param name="dateTimeFormat">If <paramref name="deleteWhiteSpaces"/> is true,
 ///  then this parameter used for send date serialization.</param>
 ///  <param name="fixTitleWhitespaces">Fix repeating whitespaces in title flag.</param>
 /// <returns>Unique hash for email instance.</returns>
 protected string GetEmailHash(DateTime sendDate, string title, string body, TimeZoneInfo timeZoneInfo,
                               bool deleteWhiteSpaces   = true, string dateTimeFormat = "yyyy-MM-dd HH:mm",
                               bool fixTitleWhitespaces = true)
 {
     return(ActivityUtils.GetEmailHash(sendDate, title, body, timeZoneInfo, deleteWhiteSpaces, dateTimeFormat,
                                       fixTitleWhitespaces));
 }
Beispiel #2
0
 /// <inheritdoc />
 protected override void SetActivityColumnValues(Entity entity)
 {
     base.SetActivityColumnValues(entity);
     if (EmailBody.IsNotNullOrEmpty())
     {
         entity.SetColumnValue("MailHash",
                               ActivityUtils.GetEmailHash(
                                   UserConnection,
                                   entity.SafeGetColumnValue <DateTime>("SendDate"),
                                   entity.SafeGetColumnValue <string>("Title"),
                                   EmailBody,
                                   UserConnection.CurrentUser.TimeZone));
     }
 }
 /// <inheritdoc cref="IActivityUtils.GetEmailHash(UserConnection, DateTime, string, string, TimeZoneInfo)"/>
 public string GetEmailHash(UserConnection userConnection, DateTime sendDate, string title, string body,
                            TimeZoneInfo timeZoneInfo)
 {
     return(ActivityUtils.GetEmailHash(userConnection, sendDate, title, body, timeZoneInfo));
 }