Example #1
0
def force_register_client(first_name: str, email: str, source: str = 'unknown') -> _User:
    """
    Create a new user on the system generation a random password or update existing one based on email.
    An Welcome email is sent to the user informing his password with the link to change it.
    User is also registered on Mailchimp. But she will be registered even if api call fails
    :param first_name: User's first name
    :param email: User's email
    :param source: source of User traffic
    :return: User
    """
    user = _core_facade.register_client(first_name, email, source)
    try:
        _mailchimp_facade.create_or_update_client(first_name, email)
    except _MailChimpError:
        pass
    return user
Example #2
0
def force_register_client(first_name: str,
                          email: str,
                          source: str = 'unknown') -> _User:
    """
    Create a new user on the system generation a random password or update existing one based on email.
    An Welcome email is sent to the user informing his password with the link to change it.
    User is also registered on Email Marketing. But she will be registered even if api call fails
    :param first_name: User's first name
    :param email: User's email
    :param source: source of User traffic
    :return: User
    """
    user = _core_facade.register_client(first_name, email, source)
    sync_user_on_discourse(user)
    try:
        _email_marketing_facade.create_or_update_client(first_name,
                                                        email,
                                                        id=user.id)
    except _ActiveCampaignError:
        pass
    return user