Exemple #1
0
def render_drip_email(profile_id, drip_milestone, format="html"):
    user = get_user_for_response(
        profile_id,
        request
    )
    email_context = drip_email_context(user, drip_milestone)
    return render_template(email_context["template"] + ".html", **email_context)
def send_drip_email(profile, drip_milestone):
    status = "started"    
    if os.getenv("ENVIRONMENT", "testing") == "production":
        email = profile.email
    else:
        email = "*****@*****.**"

    email_context = drip_email_context(profile, drip_milestone)
    msg = emailer.send(email, email_context["subject"], email_context["template"], email_context)
    status = "email sent"    
    logger.info(u"SENT EMAIL to {url_slug}!!".format(url_slug=profile.url_slug))

    return status