Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added headers for avoiding auto reply mails wherever we are sending m… #2242

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/supermarket/app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
class ApplicationMailer < ActionMailer::Base
layout "mailer"

def auto_reply_headers_off
headers("Auto-Submitted" => "auto-generated")
headers("X-Auto-Response-Suppress" => "OOF")
end
end
2 changes: 2 additions & 0 deletions src/supermarket/app/mailers/collaborator_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ def added_email(collaborator)
@resource = collaborator.resourceable
@to = collaborator.user.email

auto_reply_headers_off

mail(to: @to, subject: "You have been added as a collaborator to the #{@resource.name} #{@resource.class.name}")
end
end
6 changes: 6 additions & 0 deletions src/supermarket/app/mailers/cookbook_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ def follower_notification_email(cookbook_version, user)
@email_preference = user.email_preference_for("New cookbook version")
@to = user.email

auto_reply_headers_off

mail(to: @to, subject: "A new version of the #{@cookbook_version.name} cookbook has been released")
end

Expand All @@ -29,6 +31,8 @@ def cookbook_deleted_email(name, user)
@email_preference = user.email_preference_for("Cookbook deleted")
@to = user.email

auto_reply_headers_off

mail(to: @to, subject: "The #{name} cookbook has been deleted")
end

Expand All @@ -52,6 +56,8 @@ def cookbook_deprecated_email(cookbook, replacement_cookbook, user)
subject += " in favor of the #{@replacement_cookbook.name} cookbook"
end

auto_reply_headers_off

mail(to: @to, subject: subject)
end

Expand Down