class method
self.email_address_with_name
Ruby on Rails 7.2.3
Since v6.1.7.10Signature
self.email_address_with_name(address, name)
Returns an email in the format “Name <email@example.com>”.
If the name is a blank string, it returns just the address.
Parameters
-
addressreq -
namereq
Source
# File actionmailer/lib/action_mailer/base.rb, line 602
def email_address_with_name(address, name)
Mail::Address.new.tap do |builder|
builder.address = address
builder.display_name = name.presence
end.to_s
end
Defined in actionmailer/lib/action_mailer/base.rb line 602
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionMailer::Base