Ejemplo n.º 1
0
 public void SubscribeEmail(ISubscriber subscriber)
 {
     if (!string.IsNullOrEmpty(MailChimpSettings.RegUsersList))
     {
         MailChimpService.SubscribeListMembers(MailChimpSettings.ApiKey, MailChimpSettings.RegUsersList,
                                               new List <ISubscriber> {
             subscriber
         });
     }
 }
Ejemplo 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
                 }
             }
         });
     }
 }
Ejemplo 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);
        }