refinerycms-inquiries cannot get domain, sends emails from <no-reply@>

21 views
Skip to first unread message

ma...@markproaudio.com

unread,
Feb 20, 2016, 7:12:30 PM2/20/16
to Refinery CMS
Can anyone tell me why refinerycms-inquiries can't get the domain when sending emails? It just uses <no-reply@> for the from address. The emails are sent, but it triggers spam filters.

Do I need to set the domain or is it just not reading it properly?

From logs/production.log:

From: "Mark - KNC" <no-reply@>

Reply-To: kuronekoconmedia@example.com

To: mark@example.com

Message-ID: <56c8fc62b9ee_590a3fdfcc88291c14741@vps.markproaudio.com.mail>

Subject: Thank you for contacting KuroNekoCon

Mime-Version: 1.0

Content-Type: text/plain;

charset=UTF-8

Content-Transfer-Encoding: 7bit


Thank you for your inquiry Mark,


This email is a receipt to confirm we have received your inquiry and we'll be in touch shortly.


Thanks!


Mark O.

parndt

unread,
Feb 21, 2016, 4:37:20 AM2/21/16
to Refinery CMS
If you want to hardcode the domain, just override the from_mail method in the mailer: https://github.com/refinery/refinerycms-inquiries/blob/master/app/mailers/refinery/inquiries/inquiry_mailer.rb

You can do this by creating a decorator file at app/decorators/mailers/refinery/inquiries/inquiry_mailer_decorator.rb containing:

module InquiryFromMailDecorator

def from_mail
"no-r...@yourdomain.com"
end

end

Refinery::Inquiries::InquiryMailer.prepend InquiryFromMailDecorator

This will at least solve your issue for this site though I am not sure why it cannot figure out your domain name from the request.

ma...@markproaudio.com

unread,
Feb 23, 2016, 10:55:47 PM2/23/16
to Refinery CMS
Thanks for the code. I'm still new to Refinery so overriding it's methods is still a puzzle.

Your code worked like a charm. I also wish I knew why it doesn't get it from the request. It makes me think I didn't install something right.

Mark
Reply all
Reply to author
Forward
0 new messages