Esempio n. 1
0
 public void SubscribeEmail(ISubscriber subscriber)
 {
     if (!string.IsNullOrEmpty(MailChimpSettings.RegUsersList))
     {
         MailChimpService.SubscribeListMembers(MailChimpSettings.ApiKey, MailChimpSettings.RegUsersList,
                                               new List <ISubscriber> {
             subscriber
         });
     }
 }
Esempio n. 2
0
 public void UnsubscribeEmail(string email)
 {
     if (!string.IsNullOrEmpty(MailChimpSettings.RegUsersList))
     {
         MailChimpService.UnsubscribeListMembers(MailChimpSettings.ApiKey, MailChimpSettings.RegUsersList,
                                                 new MailChimpListMembers
         {
             Total = 1,
             Data  = new List <MailChimpListMember> {
                 new MailChimpListMember {
                     email = email
                 }
             }
         });
     }
 }
Esempio n. 3
0
        public bool SendMails(string subject, string message, MailRecipientType recipientType)
        {
            bool result = false;

            if (recipientType.HasFlag(MailRecipientType.Subscriber) && !string.IsNullOrEmpty(MailChimpSettings.RegUsersList))
            {
                result |= MailChimpService.SendMail(MailChimpSettings.ApiKey, MailChimpSettings.RegUsersList, subject,
                                                    MailChimpSettings.FromEmail, MailChimpSettings.FromName, string.Empty, message);
            }

            if (recipientType.HasFlag(MailRecipientType.OrderCustomer) && !string.IsNullOrEmpty(MailChimpSettings.OrderCustomersList))
            {
                result |= MailChimpService.SendMail(MailChimpSettings.ApiKey, MailChimpSettings.OrderCustomersList, subject,
                                                    MailChimpSettings.FromEmail, MailChimpSettings.FromName, string.Empty, message);
            }

            return(result);
        }