()
Reminds inactive users registered 24 hrs ago to activate their account.
Reminds inactive users registered 24 hrs ago to activate their account.
Reminds inactive users registered 24 hrs ago to activate their account .
def activation_24hr_reminder_email():
    """
    Reminds inactive users registered 24 hrs ago to activate their account.
    """
    request_reminders = RegistrationRequest.get_requests_24hrs_ago()

    for request in request_reminders:
        user = WebUser.get_by_username(request.new_user_username)
        registration_link = 'http://' + get_site_domain() + reverse(
            'registration_confirm_domain') + request.activation_guid + '/'
        email_context = {
            "domain": request.domain,
            "registration_link": registration_link,
            "full_name": user.full_name,
            "first_name": user.first_name,
            'url_prefix': get_static_url_prefix(),
        }

        message_plaintext = render_to_string(
            'registration/email/confirm_account_reminder.txt', email_context)
        message_html = render_to_string(
            'registration/email/confirm_account.html', email_context)
        subject = ugettext('Reminder to Activate your CommCare project')

        recipient = user.get_email() if user else request.new_user_username
        send_html_email_async.delay(
            subject, recipient, message_html,
            text_content=message_plaintext,
            email_from=settings.DEFAULT_FROM_EMAIL
        )
def activation_24hr_reminder_email ( ) : request_reminders = RegistrationRequest . get_requests_24hrs_ago ( ) for request in request_reminders : user = WebUser . get_by_username ( request . new_user_username ) registration_link = 'http://' + get_site_domain ( ) + reverse ( 'registration_confirm_domain' ) + request . activation_guid + '/' email_context = { "domain" : request . domain , "registration_link" : registration_link , "full_name" : user . full_name , "first_name" : user . first_name , 'url_prefix' : get_static_url_prefix ( ) , } message_plaintext = render_to_string ( 'registration/email/confirm_account_reminder.txt' , email_context ) message_html = render_to_string ( 'registration/email/confirm_account.html' , email_context ) subject = ugettext ( 'Reminder to Activate your CommCare project' ) recipient = user . get_email ( ) if user else request . new_user_username send_html_email_async . delay ( subject , recipient , message_html , text_content = message_plaintext , email_from = settings . DEFAULT_FROM_EMAIL )