/// <summary> /// Initialize a TypedMailTemplate subclass for rendering /// </summary> public virtual void Initialize(string countryCode, int orgId, OutboundMail mail, string variant) { Initialize(countryCode, orgId, variant); try { DeserializePlaceHolders(mail.Body); } catch (Exception ex) { try { //try to handle old mail format... just in case. SetPlaceHolder("BodyContent", mail.Body); SetPlaceHolder("IntroContent", string.Empty); SetPlaceHolder("GeographyName", mail.Geography.Name); SetPlaceHolder("OrgName", mail.Organization.Name); } catch (Exception) { //didnt't work, throw the original error throw new Exception("Failed to deserialize placeholders:", ex); } } }
public static OutboundMailRecipients FromArray(BasicOutboundMailRecipient[] basicArray, OutboundMail mail) { OutboundMailRecipients result = new OutboundMailRecipients(); result.Capacity = basicArray.Length * 11 / 10; foreach (BasicOutboundMailRecipient basic in basicArray) { result.Add(OutboundMailRecipient.FromBasic(basic, mail)); } return(result); }
public OutboundMail CreateOutboundFake(Person author, Organization organization, Geography geography) { return(OutboundMail.CreateFake(author, BaseName, SerializePlaceHolders(), 0, MailType, organization, geography)); }
public OutboundMail CreateFunctionalOutboundMail(MailAuthorType authorType, int mailPriority, Organization organization, Geography geography, DateTime releaseDateTime) { return(OutboundMail.CreateFunctional(authorType, BaseName, SerializePlaceHolders(), mailPriority, MailType, organization.Identity, geography.Identity, releaseDateTime)); }
/// <summary> /// Create OutboundMail with personal sender /// </summary> public OutboundMail CreateOutboundMail(Person author, int mailPriority, Organization organization, Geography geography, DateTime releaseDateTime) { return(OutboundMail.Create(author, BaseName, SerializePlaceHolders(), mailPriority, MailType, organization, geography, releaseDateTime)); }
public static void Create(OutboundMail outboundMail, Reporter person, bool asOfficer) { Create(outboundMail.Identity, person.Identity, asOfficer, (int)RecipientType.Reporter); }
private OutboundMailRecipient(BasicOutboundMailRecipient basic, OutboundMail outboundMail) : base(basic) { this.outboundMail = outboundMail; }
internal static OutboundMailRecipient FromBasic(BasicOutboundMailRecipient basic, OutboundMail outboundMail) { return(new OutboundMailRecipient(basic, outboundMail)); }
internal static OutboundMailRecipient FromBasic (BasicOutboundMailRecipient basic, OutboundMail outboundMail) { return new OutboundMailRecipient(basic, outboundMail); }
private OutboundMailRecipient (BasicOutboundMailRecipient basic, OutboundMail outboundMail) : base(basic) { this.outboundMail = outboundMail; }
public static void Create (OutboundMail outboundMail, Reporter person, bool asOfficer) { Create(outboundMail.Identity, person.Identity, asOfficer,(int)RecipientType.Reporter); }
/// <summary> /// Initialize a TypedMailTemplate subclass for rendering /// </summary> public virtual void Initialize (string countryCode, int orgId, OutboundMail mail, string variant) { Initialize(countryCode, orgId, variant); try { this.DeserializePlaceHolders(mail.Body); } catch (Exception ex) { try { //try to handle old mail format... just in case. this.SetPlaceHolder("BodyContent", mail.Body); this.SetPlaceHolder("IntroContent", string.Empty); this.SetPlaceHolder("GeographyName", mail.Geography.Name); this.SetPlaceHolder("OrgName", mail.Organization.Name); } catch (Exception) { //didnt't work, throw the original error throw new Exception("Failed to deserialize placeholders:", ex); } } }