Ejemplo n.º 1
0
def forgot_password_emailer(email, hash_key):
    message = render_template('emails/forgot_password.html', {'email':email,
                                                              'hash_key':hash_key}) 
    default_emailer(from_email=DEFAULT_FROM_EMAIL,
                    to_emails=[email],
                    message=message,
                    subject='Reset my Password')
Ejemplo n.º 2
0
def invitation_emailer(from_email, to_emails, from_name=''):
    message = render_template('emails/invitation.html', {'inviter_name':from_name,
                                                         'inviter_email':from_email}) 
    default_emailer(from_email=from_email,
                    to_emails=to_emails,
                    message=message,
                    from_name=from_name,
                    subject='Hi, This is %s' % from_name)
Ejemplo n.º 3
0
def new_anwer_emailer(question, new_answer):
    messages_info = []
    subject = 'New Answer for:%s' % question.title
    message = render_template('emails/new_answer.html', {'question':question,
                                                         'new_answer':new_answer})
    all_related_users_emails = question.all_related_users_emails()
    for email in all_related_users_emails:
        messages_info.append((subject, message, DEFAULT_FROM_EMAIL, [email]))
    send_mass_mail(messages_info)
Ejemplo n.º 4
0
 def process_response(self, request, response):
     path_info = request.META.get('PATH_INFO')
     if not request.is_ajax() and not re.findall(
             r'(ico|css|png|js|site_media)',
             path_info) and response.status_code == 200:
         stats_content = render_template('stats.html',
                                         {'stats': get_stats()})
         response.content = re.sub(r'<body>', '<body>%s' % stats_content,
                                   response.content)
     return response
Ejemplo n.º 5
0
def welcome_emailer(to_email, to_name):
    message = render_template('emails/welcome.html', {'name':to_name}) 
    default_emailer(from_email=DEFAULT_FROM_EMAIL,
                    to_emails=[address_email_with_name(to_email, to_name)],
                    message=message,
                    subject='Welcome to Stud2.0')
Ejemplo n.º 6
0
 def process_response(self, request, response):
     path_info = request.META.get('PATH_INFO')
     if not request.is_ajax() and not re.findall(r'(ico|css|png|js|site_media)', path_info) and response.status_code == 200:
         stats_content = render_template('stats.html', {'stats':get_stats()})
         response.content = re.sub(r'<body>', '<body>%s' % stats_content, response.content)
     return response