app/soc/logic/mail_dispatcher.py
changeset 1600 0aa3de1b2acc
parent 1560 656aace0b15f
child 1655 ed1df29f4fd9
equal deleted inserted replaced
1599:b56976cac36b 1600:0aa3de1b2acc
    65 
    65 
    66 
    66 
    67 from django.template import loader
    67 from django.template import loader
    68 
    68 
    69 from google.appengine.api import mail
    69 from google.appengine.api import mail
    70 from google.appengine.api import users
       
    71 
    70 
    72 from soc.logic import dicts
    71 from soc.logic import dicts
    73 
    72 
    74 
    73 
    75 def sendMailFromTemplate(template, context):
    74 def sendMailFromTemplate(template, context):
   145 
   144 
   146   if site_entity.noreply_email:
   145   if site_entity.noreply_email:
   147     return (site_entity.site_name, site_entity.noreply_email)
   146     return (site_entity.site_name, site_entity.noreply_email)
   148 
   147 
   149   # use the email address of the current logged in user
   148   # use the email address of the current logged in user
   150   account = users.get_current_user()
   149   account = accounts.getCurrentAccount(normalize=False)
   151 
   150 
   152   # we need to retrieve account seperately, as user_logic normalizes it
   151   # we need to retrieve account seperately, as user_logic normalizes it
   153   # and the GAE admin API is case sensitive
   152   # and the GAE admin API is case sensitive
   154   user_entity = user_logic.logic.getForAccount(account)
   153   user_entity = user_logic.logic.getForAccount(account)
   155 
   154