diff options
author | Louise Crow <louise.crow@gmail.com> | 2014-03-04 10:46:46 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2014-03-04 10:46:46 +0000 |
commit | ede46dc8dc6c97cdad8c3fcb3bd42ede5c25f395 (patch) | |
tree | 44e03358c9fa7ca6826e631d1d3d6c1030b1b0d5 /app/mailers/info_request_batch_mailer.rb | |
parent | 8e911d5bd0e60a0e0e4859868662cc176419d2e3 (diff) | |
parent | a38b2989aebf8d554b7287e18528bed8c9e67d3b (diff) |
Merge branch 'release/0.17'0.17
Diffstat (limited to 'app/mailers/info_request_batch_mailer.rb')
-rw-r--r-- | app/mailers/info_request_batch_mailer.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/app/mailers/info_request_batch_mailer.rb b/app/mailers/info_request_batch_mailer.rb new file mode 100644 index 000000000..a2becfb24 --- /dev/null +++ b/app/mailers/info_request_batch_mailer.rb @@ -0,0 +1,25 @@ +# models/info_request_batch_mailer.rb: +# Emails relating to user accounts. e.g. Confirming a new account +# +# Copyright (c) 2013 UK Citizens Online Democracy. All rights reserved. +# Email: hello@mysociety.org; WWW: http://www.mysociety.org/ + +class InfoRequestBatchMailer < ApplicationMailer + + def batch_sent(info_request_batch, unrequestable, user) + @info_request_batch, @unrequestable = info_request_batch, unrequestable + headers('Return-Path' => blackhole_email, 'Reply-To' => contact_from_name_and_email) + + # Make a link going to the info request batch page, which logs the user in. + post_redirect = PostRedirect.new( + :uri => info_request_batch_url(@info_request_batch), + :user_id => info_request_batch.user_id) + post_redirect.save! + @url = confirm_url(:email_token => post_redirect.email_token) + + mail(:from => contact_from_name_and_email, + :to => user.name_and_email, + :subject => _("Your batch request \"{{title}}\" has been sent", + :title => info_request_batch.title)) + end +end |