Provider¶
The provider offers the get, create, all and filters methods for objects: lists, groups, recipient, messages, attachments, tags.
create_list¶
-
create_list
(data_dict)¶ Create a List on Mailup
Parameters: data_dict (dict) – data dict of list
Returns: List instance
Return type: List
Raises: - InvalidListConfigurationException – bad data dict
- ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
get_list¶
-
get_list
(list_id)¶ Retrieve a List instance with id = list_id
Parameters: list_id (int) – id of list
Returns: List instance
Return type: List
Raises: - ListNotFoundException – if a list with id = list_id does not exists on your MailUp account
- ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
all_lists¶
-
all_lists
()¶ Retrieve a instance list of all List on your MailUp account
Returns: instance list
Return type: list
Raises: - ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
filter_lists¶
-
filter_lists
(filters)¶ Retrieve a instance list of all List on MailUp filtered by filters dict; filters is structured like data_dict, in fact you can use own data_dict. The ‘==’ operator is applied (refer to MailUp documentation for detail.)
Returns: instance list
Return type: list
Raises: - ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
create_group¶
-
create_group
(data_dict)¶ Create a Group on List, List on which it is created is defined in data_dict
Parameters: data_dict (dict) – data dict of group
Returns: Group instance
Return type: Group
Raises: - InvalidGroupConfigurationException – bad data dict
- ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
get_group¶
-
get_group
(list_id, group_id)¶ Retrieve a Group in a List with id list_id instance with id = group_id
Parameters: - list_id (int) – id of the List in which to retrieve the group
- group_id (int) – id of group to retrieve
Returns: Group instance
Return type: Group
Raises: - GroupNotFoundException – if a group with id = group_id does not exists on list with id = list_id
- ListNotFoundException – if a list with id = list_id does not exists on your MailUp account
- ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
all_groups¶
-
all_groups
(list_id)¶ Retrieve a instance list of all Group on List with id = list_id
Parameters: list_id (int) – id of the List in which to retrieve the group list
Returns: list of Group instance
Return type: list
Raises: - ListNotFoundException – if a list with id = list_id does not exists on your MailUp account
- ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
filter_groups¶
-
filter_groups
(list_id, filters)¶ Retrieve a instance list of all Group on List with id=list_id filtered by filters dict; filters is structured like data_dict, in fact you can use own data_dict. The ‘==’ operator is applied (refer to MailUp documentation for detail.)
Returns: instance list
Return type: list
Raises: - ListNotFoundException – if a list with id = list_id does not exists on your MailUp account
- ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
create_recipient¶
-
create_recipient
(recipient_data_dict, confirm_email=False)¶ Create a Recipient on List, List on which it is created is defined in recipient_data_dict
Parameters: - recipient_data_dict (dict) – data dict of recipient
- confirm_email (bool) –
refer to MailUp documentation
Returns: Recipient instance
Return type: Recipient
Raises: - InvalidRecipientConfigurationException – bad data dict
- RecipientAlreadyExistException – email of recipient to create already exists in list
- ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
get_recipient¶
-
get_recipient
(list_id, recipient_id=None, email=None, status=None)¶ Retrieve a Recipient in a List with id list_id instance with id = group_id and email = email in status = status. You are not obliged to specify all the parameters but only those that you need.
Parameters: - list_id (int) – id of the List in which to retrieve the recipient
- recipient_id (int) – recipient id to find
- email (str) – recipient email to find
- status (str) – status is a string in ‘subscribed’ ‘unsubscribed’ or ‘pending’, None for consider all
Returns: Recipient instance
Return type: Recipient
Raises: - RecipientNotFoundException – if the recipient is not found on list with id = list_id
- ListNotFoundException – if a list with id = list_id does not exists on your MailUp account
- InvalidRecipientStatusException – status not in ‘subscribed’ ‘unsubscribed’ or ‘pending’
- ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
all_subscribe_recipients¶
-
all_subscribe_recipients
(list_id)¶ Retrieve a instance list of all Recipient on List with id = list_id in ‘subscribed’ status
Parameters: list_id (int) – id of the List in which to retrieve the recipients
Returns: list of Recipient instance
Return type: list
Raises: - ListNotFoundException – if a list with id = list_id does not exists on your MailUp account
- ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
all_unsubscribe_recipients¶
-
all_unsubscribe_recipients
(list_id)¶ Retrieve a instance list of all Recipient on List with id = list_id in ‘unsubscribed’ status
Parameters: list_id (int) – id of the List in which to retrieve the recipients
Returns: list of Recipient instance
Return type: list
Raises: - ListNotFoundException – if a list with id = list_id does not exists on your MailUp account
- ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
all_pending_recipients¶
-
all_pending_recipients
(list_id)¶ Retrieve a instance list of all Recipient on List with id = list_id in ‘pending’ status
Parameters: list_id (int) – id of the List in which to retrieve the recipients
Returns: list of Recipient instance
Return type: list
Raises: - ListNotFoundException – if a list with id = list_id does not exists on your MailUp account
- ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
all_pending_recipients¶
-
all_pending_recipients
(list_id) Retrieve a instance list of all Recipient on List with id = list_id in ‘pending’ status
Parameters: list_id (int) – id of the List in which to retrieve the recipients
Returns: list of Recipient instance
Return type: list
Raises: - ListNotFoundException – if a list with id = list_id does not exists on your MailUp account
- ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
all_recipients¶
-
all_recipients
(list_id)¶ Retrieve a instance list of all Recipient on List with id = list_id in any status
Parameters: list_id (int) – id of the List in which to retrieve the recipients
Returns: list of Recipient instance
Return type: list
Raises: - ListNotFoundException – if a list with id = list_id does not exists on your MailUp account
- ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
filter_recipients¶
-
filter_recipients
(list_id, filters)¶ Retrieve a instance list of all Recipients on List with id=list_id filtered by filters dict; filters is structured like data_dict, in fact you can use own data_dict. The ‘==’ operator is applied (refer to MailUp documentation for detail.)
Returns: instance list
Return type: list
Raises: - ListNotFoundException – if a list with id = list_id does not exists on your MailUp account
- ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
create_message¶
-
create_message
(message_data_dict, content='', embed=False, is_confirmation=False, tracking_info=None)¶ Create a Recipient on List, List on which it is created is defined in message_data_dict
Parameters: - message_data_dict (dict) – data dict
- content (str) – content
- embed (bool) – embed
- is_confirmation (bool) – is_confirmation
- tracking_info (dict) – tracking_info
Returns: Message instance
Return type: Message
Raises: - InvalidMessageConfigurationException – bad data dict
- ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
get_message¶
-
get_message
(list_id, message_id)¶ Retrieve a Message in a List with id list_id instance with id = group_id
Parameters: - list_id (int) – id of the List in which to retrieve the message
- message_id (int) – id of message to retrieve
Returns: Message instance
Return type: Message
Raises: - MessageNotFoundException – if a message is not found on list with id = list_id
- ListNotFoundException – if a list with id = list_id does not exists on your MailUp account
- ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
all_messages¶
-
all_messages
(list_id, status=None)¶ Retrieve a instance list of all messages on List with id = list_id in status = status
Parameters: - list_id (int) – id of the List in which to retrieve the messages
- status (str) – status is a string in ‘published’ or ‘archived’, None for consider all
Returns: list of Message instance
Return type: list
Raises: - ListNotFoundException – if a list with id = list_id does not exists on your MailUp account
- ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
all_published_messages¶
-
all_published_messages
(list_id)¶ Retrieve a instance list of all messages on List with id = list_id in ‘published’ status
Parameters: list_id (int) – id of the List in which to retrieve the messages
Returns: list of Message instance
Return type: list
Raises: - ListNotFoundException – if a list with id = list_id does not exists on your MailUp account
- ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
all_archived_messages¶
-
all_archived_messages
(list_id)¶ Retrieve a instance list of all messages on List with id = list_id in ‘archived’ status
Parameters: list_id (int) – id of the List in which to retrieve the messages
Returns: list of Message instance
Return type: list
Raises: - ListNotFoundException – if a list with id = list_id does not exists on your MailUp account
- ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
filter_messages¶
-
filter_messages
(list_id, filters)¶ Retrieve a instance list of all Messages on List with id=list_id filtered by filters dict; filters is structured like data_dict, in fact you can use own data_dict. The ‘==’ operator is applied (refer to MailUp documentation for detail.)
Returns: instance list
Return type: list
Raises: - ListNotFoundException – if a list with id = list_id does not exists on your MailUp account
- ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
create_tag¶
-
create_tag
(data_dict)¶ Create a Tag on List, List on which it is created is defined in data_dict
Parameters: data_dict (dict) – data dict
Returns: Tag instance
Return type: Tag
Raises: - InvalidTagConfigurationException – bad data dict
- TagAlreadyExistException – tag with data_dict[‘name’] already exists
- ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
get_tag¶
-
get_tag
(tag_id=None, tag_name=None)¶ Retrieve a Tag instance with id = tag_id and name = email in a List with id list_id . You are not obliged to specify all the parameters but only those that you need.
Parameters: - tag_id (int) – tag id to find
- tag_name (str) – tag name to find
Returns: Tag instance
Return type: Tag
Raises: - TagNotFoundException – if the tag is not found on list with id = list_id
- ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
all_tags¶
Retrieve a instance list of all tags on List with id = list_id
Parameters: list_id (int) – id of the List in which to retrieve the tags
Returns: list of Tag instance
Return type: list
Raises: - ListNotFoundException – if a list with id = list_id does not exists on your MailUp account
- ClientNotEnabledException – provider as not a client configured
- MailUpCallError – Error calling the API
all_attachments¶
-
all_attachments
(list_id, message_id)¶ Retrieve a instance list of all attachments of message with id = message_id
Parameters: - list_id (int) – id of the List in which to retrieve the attachments
- message_id (int) – id of the Message to which are attached
Returns: list of Attachments instance
Return type: list
Raises: - ClientNotEnabledException – provider as not a client configured
- MessageNotFoundException – message_id not exists
- ListNotFoundException – if a list with id = list_id does not exists on your MailUp account
- MailUpCallError – Error calling the API
get_attachments¶
-
get_attachments
(list_id, message_id, file_name=None, slot=None)¶ Retrieve a instance list of all attachments of message with id = message_id. If file_name and slot are passed attachments are filtered
Parameters: - list_id (int) – id of the List in which to retrieve the attachments
- message_id (int) – id of the Message to which are attached
- file_name (int) – name of file to filter
- slot (int) – slot of file to filter. slut must be >= 1 and <= 5
Returns: list of Attachments instance
Return type: list
Raises: - ClientNotEnabledException – provider as not a client configured
- MessageNotFoundException – message_id not exists
- ListNotFoundException – if a list with id = list_id does not exists on your MailUp account
- MailUpCallError – Error calling the API