示例#1
0
def promote_webdev(user: _User, source: str) -> _User:
    """
    Promote a user to Webdev role and change it's role on Email Marketing. Will not fail in case API call fails.
    Email welcome email is sent to user
    :param source: source of traffic
    :param user:
    :return:
    """
    _core_facade.promote_to_webdev(user, source)
    sync_user_on_discourse.delay(user.id)
    _email_marketing_facade.create_or_update_webdev.delay(user.first_name, user.email, id=user.id)
    return user
示例#2
0
def promote_webdev(user: _User, source: str) -> _User:
    """
    Promote a user to Webdev role and change it's role on Email Marketing. Will not fail in case API call fails.
    Email welcome email is sent to user
    :param source: source of traffic
    :param user:
    :return:
    """
    _core_facade.promote_to_webdev(user, source)
    sync_user_on_discourse(user)
    try:
        _email_marketing_facade.create_or_update_webdev(user.first_name,
                                                        user.email,
                                                        id=user.id)
    except _ActiveCampaignError:
        pass
    email_msg = render_to_string('checkout/webdev_email.txt', {
        'user': user,
    })
    _send_mail(
        'Inscrição no Curso Webdev Django realizada! Confira o link com detalhes.',
        email_msg, _settings.DEFAULT_FROM_EMAIL, [user.email])
    return user