Created
December 17, 2014 10:27
-
-
Save sunny/3c2c7b23285fbc5c5257 to your computer and use it in GitHub Desktop.
Application Mailer helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/email_with_name.rb | |
module EmailWithName | |
def email_with_name(email, name) | |
name = name.gsub(/"<>/, '') | |
"#{name} <#{email}>" | |
end | |
end | |
# app/mailers/application_mailer.rb | |
class ApplicationMailer < ActionMailer::Base | |
include EmailWithName | |
extend EmailWithName | |
default from: email_with_name("[email protected]", "Cults.") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment