public static void SendNews(TypeRecepient type, string txtTitle, string text) { if (CustomerSession.CurrentCustomer.IsVirtual) { return; } switch (type) { case TypeRecepient.All: if (SettingsMailChimp.MailChimpAllUsersList.IsNotEmpty()) { MailChimp.SendMail(SettingsMailChimp.MailChimpId, SettingsMailChimp.MailChimpRegUsersList, txtTitle, SettingsMail.From, SettingsMain.ShopName, string.Empty, text); MailChimp.SendMail(SettingsMailChimp.MailChimpId, SettingsMailChimp.MailChimpUnRegUsersList, txtTitle, SettingsMail.From, SettingsMain.ShopName, string.Empty, text); //MailChimp.SendMail(SettingsMailChimp.MailChimpId, SettingsMailChimp.MailChimpAllUsersList, txtTitle, SettingsMail.From, SettingsMain.ShopName, string.Empty, text); } break; case TypeRecepient.Reg: if (SettingsMailChimp.MailChimpRegUsersList.IsNotEmpty()) { MailChimp.SendMail(SettingsMailChimp.MailChimpId, SettingsMailChimp.MailChimpRegUsersList, txtTitle, SettingsMail.From, SettingsMain.ShopName, string.Empty, text); } break; case TypeRecepient.Unreg: if (SettingsMailChimp.MailChimpUnRegUsersList.IsNotEmpty()) { MailChimp.SendMail(SettingsMailChimp.MailChimpId, SettingsMailChimp.MailChimpUnRegUsersList, txtTitle, SettingsMail.From, SettingsMain.ShopName, string.Empty, text); } break; } }
protected void btnSend_Click(object sender, EventArgs e) { if (!IsValidData()) { return; } if (SettingsMailChimp.MailChimpActive) { if (rbToAll.Checked) { MailChimp.SendMail(SettingsMailChimp.MailChimpId, SettingsMailChimp.MailChimpRegUsersList, txtTitle.Text, SettingsMail.From, SettingsMain.ShopName, string.Empty, fckMailContent.Text); MailChimp.SendMail(SettingsMailChimp.MailChimpId, SettingsMailChimp.MailChimpUnRegUsersList, txtTitle.Text, SettingsMail.From, SettingsMain.ShopName, string.Empty, fckMailContent.Text); } if (rbToReg.Checked) { MailChimp.SendMail(SettingsMailChimp.MailChimpId, SettingsMailChimp.MailChimpRegUsersList, txtTitle.Text, SettingsMail.From, SettingsMain.ShopName, string.Empty, fckMailContent.Text); } if (rbToUnReg.Checked) { MailChimp.SendMail(SettingsMailChimp.MailChimpId, SettingsMailChimp.MailChimpUnRegUsersList, txtTitle.Text, SettingsMail.From, SettingsMain.ShopName, string.Empty, fckMailContent.Text); } } mvSendingMessages.SetActiveView(vFinishForm); }