Permalink
Browse files

Add config which allows to configure "from" name in email notifications.

  • Loading branch information...
1 parent 0e2e10a commit 34ed1349836a184f7f7c06d4d6e4086d072e6122 @ugisozols ugisozols committed with ugisozols Jun 14, 2013
@@ -9,7 +9,7 @@ def confirmation(inquiry, request)
:from => ::I18n.t('from_name',
:scope => 'refinery.inquiries.config',
:site_name => Refinery::Core.site_name,
- :name => @inquiry.name) + " <no-reply@#{request.domain}>",
+ :name => @inquiry.name) + " <#{Refinery::Inquiries.from_name}@#{request.domain}>",
:reply_to => Refinery::Inquiries::Setting.notification_recipients.split(',').first
end
@@ -20,7 +20,7 @@ def notification(inquiry, request)
:from => ::I18n.t('from_name',
:scope => 'refinery.inquiries.config',
:site_name => Refinery::Core.site_name,
- :name => @inquiry.name) + " <no-reply@#{request.domain}>",
+ :name => @inquiry.name) + " <#{Refinery::Inquiries.from_name}@#{request.domain}>",
:reply_to => inquiry.email
end
@@ -10,4 +10,7 @@ Refinery::Inquiries.configure do |config|
# Configure whether inquiries marked as spam should also send a notification mail
# config.send_notifications_for_inquiries_marked_as_spam = <%= Refinery::Inquiries.send_notifications_for_inquiries_marked_as_spam.inspect %>
+
+ # Configure name in 'from' email address
+ # config.from_name = <%= Refinery::Inquiries.from_name.inspect %>
end
@@ -6,10 +6,12 @@ module Inquiries
config_accessor :show_phone_number_field
config_accessor :show_placeholders
config_accessor :send_notifications_for_inquiries_marked_as_spam
+ config_accessor :from_name
self.show_contact_privacy_link = true
self.show_phone_number_field = true
self.show_placeholders = true
self.send_notifications_for_inquiries_marked_as_spam = false
+ self.from_name = "no-reply"
end
end

0 comments on commit 34ed134

Please sign in to comment.