Esempio n. 1
0
		public System.Net.Mail.MailMessage PreviewMessage(Content.HtmlTemplate t, MerchantTribeApplication app)
		{
			System.Net.Mail.MailMessage result = new System.Net.Mail.MailMessage();

			if (this.Members.Count > 0) {
				if (t != null) {
                    Content.HtmlTemplate copy = t.ReplaceTagsInTemplate(app, this.Members[0]);
                    result = copy.ConvertToMailMessage(this.Members[0].EmailAddress);
				}
			}

			return result;
		}
Esempio n. 2
0
        // Mailing List Send Functions
		public void SendToList(Content.HtmlTemplate t, bool sendAsync, MerchantTribeApplication app)
		{			
			if (t != null) {				
					foreach (MailingListMember m in this.Members) {
						try {
                            Content.HtmlTemplate copy = t.ReplaceTagsInTemplate(app, m);
							System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage();
							msg = copy.ConvertToMailMessage(m.EmailAddress);
							if (msg != null) {
								Utilities.MailServices.SendMail(msg, app.CurrentStore);
							}
						}
						catch (Exception ex) {
							EventLog.LogEvent(ex);
						}
					}				
			}
		}