def add(self, list_id, name, surname, email, custom_fields): subscriber = createsend.Subscriber({'api_key': self.api_key}) r = subscriber.add( list_id, email, " ".join([name, surname]), custom_fields, True, ) return r
def add(self, email, custom_fields): subscriber = createsend.Subscriber({"api_key": self.api_key}) r = subscriber.add( self.list_id, email, " ".join([custom_fields["first_name"], custom_fields["last_name"]]), self.translate_fields(custom_fields), True, ) return r
def update(self, list_id, mailing_id, name, surname, email, custom_fields): subscriber = createsend.Subscriber({'api_key': self.api_key}, list_id, mailing_id) subscriber.get(list_id, mailing_id) subscriber.update( email, " ".join([name, surname]), custom_fields, True, ) return subscriber.email_address
def update(self, mailing_id, email, custom_fields): subscriber = createsend.Subscriber({"api_key": self.api_key}, self.list_id, mailing_id) subscriber.get(self.list_id, mailing_id) subscriber.update( email, " ".join([custom_fields["first_name"], custom_fields["last_name"]]), self.translate_fields(custom_fields), True, ) return subscriber.email_address
def delete(self, mailing_id, email): subscriber = createsend.Subscriber({"api_key": self.api_key}, self.list_id, mailing_id) subscriber.get(self.list_id, mailing_id) r = subscriber.delete() return r
def delete(self, list_id, mailing_id): subscriber = createsend.Subscriber({'api_key': self.api_key}, list_id, mailing_id) subscriber.get(list_id, mailing_id) r = subscriber.delete() return r