aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenare Degan <henare.degan@gmail.com>2013-02-26 13:43:04 +1100
committerHenare Degan <henare.degan@gmail.com>2013-02-26 14:22:28 +1100
commitb88637f0e0043cb5e71179dbd19e14900b07fe86 (patch)
tree16cc211767f65c75c806eaceb1827869d187a2c5
parentd8b608cdc3571646bb3634553db964d7921f4a79 (diff)
Upgrade TrackMailer to new ActionMailer API
-rw-r--r--app/mailers/track_mailer.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/app/mailers/track_mailer.rb b/app/mailers/track_mailer.rb
index 327c5c8cd..1ddce4a7e 100644
--- a/app/mailers/track_mailer.rb
+++ b/app/mailers/track_mailer.rb
@@ -6,22 +6,23 @@
class TrackMailer < ApplicationMailer
def event_digest(user, email_about_things)
+ @user, @email_about_things = user, email_about_things
+
post_redirect = PostRedirect.new(
:uri => main_url(user_url(user)) + "#email_subscriptions",
:user_id => user.id)
post_redirect.save!
- unsubscribe_url = confirm_url(:email_token => post_redirect.email_token)
+ @unsubscribe_url = confirm_url(:email_token => post_redirect.email_token)
- @from = contact_from_name_and_email
- headers 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
- 'Precedence' => 'bulk' # http://www.vbulletin.com/forum/project.php?issueid=27687 (Exchange hack)
+ headers('Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
+ 'Precedence' => 'bulk')# http://www.vbulletin.com/forum/project.php?issueid=27687 (Exchange hack)
# 'Return-Path' => blackhole_email, 'Reply-To' => @from # we don't care about bounces for tracks
# (We let it return bounces for now, so we can manually kill the tracks that bounce so Yahoo
# etc. don't decide we are spammers.)
- @recipients = user.name_and_email
- @subject = _("Your {{site_name}} email alert", :site_name => site_name)
- @body = { :user => user, :email_about_things => email_about_things, :unsubscribe_url => unsubscribe_url }
+ mail(:from => contact_from_name_and_email,
+ :to => user.name_and_email,
+ :subject => _("Your {{site_name}} email alert", :site_name => site_name))
end
def contact_from_name_and_email