示例#1
0
 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
示例#2
0
 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
示例#3
0
 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
示例#4
0
 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
示例#5
0
 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
示例#6
0
 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