Example #1
0
        /// <summary>
        ///   The add recipient variable.
        /// </summary>
        /// <param name="recipient">
        ///   The recipient.
        /// </param>
        /// <param name="name">
        ///   The name.
        /// </param>
        /// <param name="content">
        ///   The content.
        /// </param>
        public void AddRecipientVariable(string recipient, string name, dynamic content)
        {
            if (MergeVars == null)
            {
                MergeVars = new List <RcptMergeVar>();
            }

            RcptMergeVar entry = MergeVars.Where(e => e.Rcpt == recipient).FirstOrDefault();

            if (entry == null)
            {
                entry = new RcptMergeVar {
                    Rcpt = recipient
                };
                MergeVars.Add(entry);
            }

            var mv = new MergeVar {
                Name = name, Content = content
            };

            entry.Vars.Add(mv);
        }
    /// <summary>
    ///   The add recipient variable.
    /// </summary>
    /// <param name="recipient">
    ///   The recipient.
    /// </param>
    /// <param name="name">
    ///   The name.
    /// </param>
    /// <param name="content">
    ///   The content.
    /// </param>
    public void AddRecipientVariable(string recipient, string name, dynamic content)
    {
      if (MergeVars == null)
      {
        MergeVars = new List<RcptMergeVar>();
      }

      RcptMergeVar entry = MergeVars.Where(e => e.Rcpt == recipient).FirstOrDefault();
      if (entry == null)
      {
        entry = new RcptMergeVar {Rcpt = recipient};
        MergeVars.Add(entry);
      }

      var mv = new MergeVar {Name = name, Content = content};

      entry.Vars.Add(mv);
    }