add list unsubscribe

This commit is contained in:
Sam 2013-04-26 16:56:28 +10:00
parent f9e33ec6b8
commit b82e408351
4 changed files with 5 additions and 0 deletions

View file

@ -1,6 +1,7 @@
require_dependency 'email_builder' require_dependency 'email_builder'
class InviteMailer < ActionMailer::Base class InviteMailer < ActionMailer::Base
default charset: 'UTF-8'
include EmailBuilder include EmailBuilder
def send_invite(invite) def send_invite(invite)

View file

@ -1,6 +1,7 @@
require_dependency 'email_builder' require_dependency 'email_builder'
class TestMailer < ActionMailer::Base class TestMailer < ActionMailer::Base
default charset: 'UTF-8'
include EmailBuilder include EmailBuilder
def send_test(to_address) def send_test(to_address)

View file

@ -2,6 +2,8 @@ require_dependency 'markdown_linker'
require_dependency 'email_builder' require_dependency 'email_builder'
class UserNotifications < ActionMailer::Base class UserNotifications < ActionMailer::Base
default charset: 'UTF-8'
include EmailBuilder include EmailBuilder
def signup(user, opts={}) def signup(user, opts={})

View file

@ -12,6 +12,7 @@ module EmailBuilder
if params[:add_unsubscribe_link] if params[:add_unsubscribe_link]
body << "\n" body << "\n"
body << I18n.t("unsubscribe_link", params) body << I18n.t("unsubscribe_link", params)
headers 'List-Unsubscribe' => "<#{params[:user_preferences_url]}>"
end end
mail_args = { mail_args = {