From b82e4083518bb1f2f124bc6435906d7cd4853b77 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 26 Apr 2013 16:56:28 +1000 Subject: [PATCH] add list unsubscribe --- app/mailers/invite_mailer.rb | 1 + app/mailers/test_mailer.rb | 1 + app/mailers/user_notifications.rb | 2 ++ lib/email_builder.rb | 1 + 4 files changed, 5 insertions(+) diff --git a/app/mailers/invite_mailer.rb b/app/mailers/invite_mailer.rb index 125eab3e3b8..c6644ddb005 100644 --- a/app/mailers/invite_mailer.rb +++ b/app/mailers/invite_mailer.rb @@ -1,6 +1,7 @@ require_dependency 'email_builder' class InviteMailer < ActionMailer::Base + default charset: 'UTF-8' include EmailBuilder def send_invite(invite) diff --git a/app/mailers/test_mailer.rb b/app/mailers/test_mailer.rb index 418b91e3428..132471d1daf 100644 --- a/app/mailers/test_mailer.rb +++ b/app/mailers/test_mailer.rb @@ -1,6 +1,7 @@ require_dependency 'email_builder' class TestMailer < ActionMailer::Base + default charset: 'UTF-8' include EmailBuilder def send_test(to_address) diff --git a/app/mailers/user_notifications.rb b/app/mailers/user_notifications.rb index 1e40e789786..00a46dba793 100644 --- a/app/mailers/user_notifications.rb +++ b/app/mailers/user_notifications.rb @@ -2,6 +2,8 @@ require_dependency 'markdown_linker' require_dependency 'email_builder' class UserNotifications < ActionMailer::Base + default charset: 'UTF-8' + include EmailBuilder def signup(user, opts={}) diff --git a/lib/email_builder.rb b/lib/email_builder.rb index dabd9ef2a9d..ee219e3e433 100644 --- a/lib/email_builder.rb +++ b/lib/email_builder.rb @@ -12,6 +12,7 @@ module EmailBuilder if params[:add_unsubscribe_link] body << "\n" body << I18n.t("unsubscribe_link", params) + headers 'List-Unsubscribe' => "<#{params[:user_preferences_url]}>" end mail_args = {