#NEWLINE# def deliver( self , recipient , sender , notice_type , extra_context ) : #NEWLINE# #INDENT# context = self . default_context ( ) #NEWLINE# context . update ( { #NEWLINE# #INDENT# 'recipient' : recipient , #NEWLINE# 'sender' : sender , #NEWLINE# 'notice' : ugettext ( notice_type . display ) , #NEWLINE# 'name' : 'Eyebrowse' , #NEWLINE# 'notices_url' : '/notifications' , #NEWLINE# 'notices_settings' : '/notifications/settings' , #NEWLINE# #UNINDENT# } ) #NEWLINE# context . update ( extra_context ) #NEWLINE# messages = self . get_formatted_messages ( ( 'short.txt' , 'full.txt' ) , notice_type . label , context ) #NEWLINE# subject = '' . join ( render_to_string ( 'notifications/email_subject.txt' , { #NEWLINE# #INDENT# 'message' : messages [ 'short.txt' ] , #NEWLINE# #UNINDENT# } , context ) . splitlines ( ) ) #NEWLINE# body = render_to_string ( 'notifications/email_body.txt' , { #NEWLINE# #INDENT# 'message' : messages [ 'full.txt' ] , #NEWLINE# #UNINDENT# } , context ) #NEWLINE# send_mail ( subject , body , settings . DEFAULT_FROM_EMAIL , [ recipient . email ] )