public EmailNotificationTemplate(XmlElement node) : base(node)
        {
            foreach (XmlElement propertyNode in node.ChildNodes)
            {
                switch (propertyNode.Name)
                {
                case "format":
                    this._Format = (EmailNotificationFormat)StringEnum.Parse(typeof(EmailNotificationFormat), propertyNode.InnerText);
                    continue;

                case "subject":
                    this._Subject = propertyNode.InnerText;
                    continue;

                case "body":
                    this._Body = propertyNode.InnerText;
                    continue;

                case "fromEmail":
                    this._FromEmail = propertyNode.InnerText;
                    continue;

                case "fromName":
                    this._FromName = propertyNode.InnerText;
                    continue;

                case "to":
                    this._To = ObjectFactory.Create <EmailNotificationRecipientProvider>(propertyNode);
                    continue;

                case "cc":
                    this._Cc = ObjectFactory.Create <EmailNotificationRecipientProvider>(propertyNode);
                    continue;

                case "bcc":
                    this._Bcc = ObjectFactory.Create <EmailNotificationRecipientProvider>(propertyNode);
                    continue;

                case "replyTo":
                    this._ReplyTo = ObjectFactory.Create <EmailNotificationRecipientProvider>(propertyNode);
                    continue;

                case "priority":
                    this._Priority = (EmailNotificationTemplatePriority)ParseEnum(typeof(EmailNotificationTemplatePriority), propertyNode.InnerText);
                    continue;

                case "confirmReadingTo":
                    this._ConfirmReadingTo = propertyNode.InnerText;
                    continue;

                case "hostname":
                    this._Hostname = propertyNode.InnerText;
                    continue;

                case "messageID":
                    this._MessageID = propertyNode.InnerText;
                    continue;

                case "customHeaders":
                    this._CustomHeaders = new List <KeyValue>();
                    foreach (XmlElement arrayNode in propertyNode.ChildNodes)
                    {
                        this._CustomHeaders.Add(ObjectFactory.Create <KeyValue>(arrayNode));
                    }
                    continue;
                }
            }
        }
 public EmailNotificationTemplate(JToken node) : base(node)
 {
     if (node["format"] != null)
     {
         this._Format = (EmailNotificationFormat)StringEnum.Parse(typeof(EmailNotificationFormat), node["format"].Value <string>());
     }
     if (node["subject"] != null)
     {
         this._Subject = node["subject"].Value <string>();
     }
     if (node["body"] != null)
     {
         this._Body = node["body"].Value <string>();
     }
     if (node["fromEmail"] != null)
     {
         this._FromEmail = node["fromEmail"].Value <string>();
     }
     if (node["fromName"] != null)
     {
         this._FromName = node["fromName"].Value <string>();
     }
     if (node["to"] != null)
     {
         this._To = ObjectFactory.Create <EmailNotificationRecipientProvider>(node["to"]);
     }
     if (node["cc"] != null)
     {
         this._Cc = ObjectFactory.Create <EmailNotificationRecipientProvider>(node["cc"]);
     }
     if (node["bcc"] != null)
     {
         this._Bcc = ObjectFactory.Create <EmailNotificationRecipientProvider>(node["bcc"]);
     }
     if (node["replyTo"] != null)
     {
         this._ReplyTo = ObjectFactory.Create <EmailNotificationRecipientProvider>(node["replyTo"]);
     }
     if (node["priority"] != null)
     {
         this._Priority = (EmailNotificationTemplatePriority)ParseEnum(typeof(EmailNotificationTemplatePriority), node["priority"].Value <string>());
     }
     if (node["confirmReadingTo"] != null)
     {
         this._ConfirmReadingTo = node["confirmReadingTo"].Value <string>();
     }
     if (node["hostname"] != null)
     {
         this._Hostname = node["hostname"].Value <string>();
     }
     if (node["messageID"] != null)
     {
         this._MessageID = node["messageID"].Value <string>();
     }
     if (node["customHeaders"] != null)
     {
         this._CustomHeaders = new List <KeyValue>();
         foreach (var arrayNode in node["customHeaders"].Children())
         {
             this._CustomHeaders.Add(ObjectFactory.Create <KeyValue>(arrayNode));
         }
     }
 }