diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-06-04 15:03:02 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-06-04 15:03:02 +0100 |
commit | a885764b65916020d9182073b38f6951a20d4b8c (patch) | |
tree | 0988651c144b65a8e46b28b376b2e72a5947d934 /app/mailers/user_mailer.rb | |
parent | eb1c465162420ad62c16dccb983cb28aa89a4639 (diff) | |
parent | a919141992a40599f99b32bd4a8312a0009f3f7a (diff) |
Merge branch 'release/0.11'0.11.0.3
Diffstat (limited to 'app/mailers/user_mailer.rb')
-rw-r--r-- | app/mailers/user_mailer.rb | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb new file mode 100644 index 000000000..a351147f9 --- /dev/null +++ b/app/mailers/user_mailer.rb @@ -0,0 +1,44 @@ +# models/user_mailer.rb: +# Emails relating to user accounts. e.g. Confirming a new account +# +# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. +# Email: hello@mysociety.org; WWW: http://www.mysociety.org/ + +class UserMailer < ApplicationMailer + def confirm_login(user, reasons, url) + @reasons, @name, @url = reasons, user.name, url + headers('Return-Path' => blackhole_email, 'Reply-To' => contact_from_name_and_email) # we don't care about bounces when people are fiddling with their account + + mail(:from => contact_from_name_and_email, + :to => user.name_and_email, + :subject => reasons[:email_subject]) + end + + def already_registered(user, reasons, url) + @reasons, @name, @url = reasons, user.name, url + headers('Return-Path' => blackhole_email, 'Reply-To' => contact_from_name_and_email) # we don't care about bounces when people are fiddling with their account + + mail(:from => contact_from_name_and_email, + :to => user.name_and_email, + :subject => reasons[:email_subject]) + end + + def changeemail_confirm(user, new_email, url) + @name, @url, @old_email, @new_email = user.name, url, user.email, new_email + headers('Return-Path' => blackhole_email, 'Reply-To' => contact_from_name_and_email) # we don't care about bounces when people are fiddling with their account + + mail(:from => contact_from_name_and_email, + :to => new_email, + :subject => _("Confirm your new email address on {{site_name}}", :site_name => site_name)) + end + + def changeemail_already_used(old_email, new_email) + @old_email, @new_email = old_email, new_email + headers('Return-Path' => blackhole_email, 'Reply-To' => contact_from_name_and_email) # we don't care about bounces when people are fiddling with their account + + mail(:from => contact_from_name_and_email, + :to => new_email, + :subject => _("Unable to change email address on {{site_name}}", :site_name=>site_name)) + end +end + |