Permalink
Browse files

adds the ability set the from email

  • Loading branch information...
gustavosoares committed Sep 5, 2012
1 parent 3bdc32f commit ae8b8517e3ac891263f891e41a1197f21e9c35d6
@@ -6,15 +6,15 @@ def confirmation(inquiry, request)
@inquiry = inquiry
mail :subject => Refinery::Inquiries::Setting.confirmation_subject(Globalize.locale),
:to => inquiry.email,
- :from => "\"#{Refinery::Core.site_name}\" <no-reply@#{request.domain}>",
+ :from => "\"#{Refinery::Core.site_name}\" <#{Refinery::Inquiries.inquiry_from_email}>",
:reply_to => Refinery::Inquiries::Setting.notification_recipients.split(',').first
end
def notification(inquiry, request)
@inquiry = inquiry
mail :subject => Refinery::Inquiries::Setting.notification_subject,
:to => Refinery::Inquiries::Setting.notification_recipients,
- :from => "\"#{Refinery::Core.site_name}\" <no-reply@#{request.domain}>"
+ :from => "\"#{Refinery::Core.site_name}\" <#{Refinery::Inquiries.inquiry_from_email}>",
end
end
@@ -20,7 +20,7 @@
<label class='stripped'><%= t('.from') %></label>
</td>
<td>
- <%= "#{Refinery::Core.site_name} &lt;no-reply@#{request.domain}&gt;".html_safe %>
+ <%= "#{Refinery::Core.site_name} &lt;#{Refinery::Inquiries.inquiry_from_email}&gt;".html_safe %>
</td>
</tr>
<% (defined?(Refinery::I18n) && Refinery::I18n.frontend_locales || [::I18n.locale]).each do |locale| %>
@@ -1,4 +1,5 @@
Refinery::Inquiries.configure do |config|
# Configure whether to show privacy link
# config.show_contact_privacy_link = <%= Refinery::Inquiries.show_contact_privacy_link.inspect %>
-end
+ # config.inquiry_from_email = <%= Refinery::Inquiries.inquiry_from_email.inspect %>
+end
@@ -2,8 +2,10 @@ module Refinery
module Inquiries
include ActiveSupport::Configurable
- config_accessor :show_contact_privacy_link
+ config_accessor :show_contact_privacy_link, :inquiry_from_email
self.show_contact_privacy_link = true
+ self.inquiry_from_email = "no-reply@localhost"
+
end
-end
+end

0 comments on commit ae8b851

Please sign in to comment.