public static List<AudienceList> GetLists(MailerAPI mailer)
        {
            List<AudienceList> ret = new List<AudienceList>();

            try {
                XmlDocument lists = mailer.AudienceLists();
                if ((lists.ChildNodes.Count > 0) && (lists.Name == "lists")) {
                    foreach(XmlNode l in lists.ChildNodes) {
                        AudienceList a = new AudienceList();
                        // Not using deserialization here as it would be major code overkill for 2 attributes.
                        // If MadMimi expands the returned values, this may be changed
                        a.ID = l.Attributes["id"].Value;
                        a.Name = l.Attributes["name"].Value;
                        ret.Add(a);
                    }
                }
            } catch (Exception e) {
                throw new Exception("Failed to retrieve audience lists. (" + e.Message + ")");
            }

            return ret;
        }
 public static bool Create(MailerAPI mailer, string ListName)
 {
     return mailer.AudienceListAdd(ListName).IsSuccess;
 }
Ejemplo n.º 3
0
 public ApiResult SendTransactional(MailerAPI api, string promotionName)
 {
     return api.SendEmail(this, promotionName);
 }
 public AudienceList(MailerAPI mailer)
 {
     Mailer = mailer; //Marc says: this value is never used.
     _init();
 }
Ejemplo n.º 5
0
 public ApiResult SendToList(MailerAPI api, string promotionName, string listName)
 {
     return api.SendPromotion(this, listName, promotionName);
 }