Beispiel #1
0
        /// <summary>
        /// Merge the specified list template with the datasource.
        /// </summary>
        /// <param name="message">The message that contain the list template field.</param>
        /// <param name="name">The name if the list template.</param>
        /// <param name="listTemplates">The ListTemplates to use.</param>
        /// <param name="dataSource">The datasource to merge with.</param>
        /// <returns>The merged message.</returns>
        public Message MergeListTemplate(Message message, string name, ListTemplateCollection listTemplates, object dataSource)
        {
            ActiveUp.Net.Mail.Logger.AddEntry("Merging Template " + name + ".", 1);

            foreach (ListTemplate listTemplate in listTemplates)
            {
                if (listTemplate.Name.ToUpper() == name.ToUpper())
                {
                    listTemplate.DataSource = dataSource;
                    message.BodyText.Text   = this.ReplaceField(message.BodyText.Text, listTemplate.Name, MergeText(listTemplate.Content, dataSource, true));
                    message.BodyHtml.Text   = this.ReplaceField(message.BodyHtml.Text, listTemplate.Name, MergeText(listTemplate.Content, dataSource, true));
                }
            }

            return(message);
        }
Beispiel #2
0
		/// <summary>
		/// Merge the specified list template with the datasource.
		/// </summary>
		/// <param name="message">The message that contain the list template field.</param>
		/// <param name="name">The name if the list template.</param>
		/// <param name="listTemplates">The ListTemplates to use.</param>
		/// <param name="dataSource">The datasource to merge with.</param>
		/// <returns>The merged message.</returns>
		public Message MergeListTemplate(Message message, string name, ListTemplateCollection listTemplates, object dataSource)
		{
			ActiveUp.Net.Mail.Logger.AddEntry("Merging Template " + name + ".", 1);

			foreach(ListTemplate listTemplate in listTemplates)
			{
				if (listTemplate.Name.ToUpper() == name.ToUpper())
				{
					listTemplate.DataSource = dataSource;
					message.BodyText.Text = this.ReplaceField(message.BodyText.Text, listTemplate.Name, MergeText(listTemplate.Content, dataSource, true));
					message.BodyHtml.Text = this.ReplaceField(message.BodyHtml.Text, listTemplate.Name, MergeText(listTemplate.Content, dataSource, true));
				}
			}

			return message;
		}
Beispiel #3
0
 /// <summary>
 /// Merge the specified list template with the datasource.
 /// </summary>
 /// <param name="name">The name of the list template.</param>
 /// <param name="listTemplates">The ListTemplates to use.</param>
 /// <param name="dataSource">The datasource to merge with.</param>
 /// <returns>The merged message.</returns>
 public Message MergeListTemplate(string name, ListTemplateCollection listTemplates, object dataSource)
 {
     return(MergeListTemplate(this.Message, name, listTemplates, dataSource));
 }
Beispiel #4
0
		/// <summary>
		/// Merge the specified list template with the datasource.
		/// </summary>
		/// <param name="name">The name of the list template.</param>
		/// <param name="listTemplates">The ListTemplates to use.</param>
		/// <param name="dataSource">The datasource to merge with.</param>
		/// <returns>The merged message.</returns>
		public Message MergeListTemplate(string name, ListTemplateCollection listTemplates, object dataSource)
		{
			return MergeListTemplate(this.Message, name, listTemplates, dataSource);
		}