cleverreach Package

utils Module

Helper functions for Django.

cleverreach.utils.insert_new_user(user, list_id, activated=None, sendmail=True, form_id=None, attrs=None, client=None)

Adds a new single receiver. If the email address already exists, an error is raised.

Keyword arguments:

  • user – Can be a dict (such as cleaned_data) or an object (such as request.user).

  • list_id – The receiver group id

  • activated – (True/False) If the new address is already activated or not (double opt-in).

    If activated is not set or None, the cleverreach default settings are used.

  • sendmail – boolean, if True, an activation email will be sent out by cleverreach.

  • form_id – (optional) The id of the form used for the list. If this is not

    provided, the first available form is used.

  • attrs – (optional) This needs to be a list in the form [‘first_name’, ‘last_name’] and

    the attribute must exist on the user object/dict.

  • client – (optional) If an instance of the api.Client exists already, you can

    pass it to the function. Otherwise a new instance is created.