how to define a host with https in action_mailer.default_url_options

m33lky picture m33lky · Feb 27, 2012 · Viewed 8.5k times · Source

ActionMailer provides a way to define the host to use with resource helpers:

config.action_mailer.default_url_options = { :host => "example.com" }

I can't find a way to force this to https.

Answer

benrugg picture benrugg · May 14, 2014

All you have to do it add "protocol" to the default url options:

config.action_mailer.default_url_options = { :host => 'example.com', :protocol => 'https'}

Dazpinto was right - linking to a duplicate question with the answer: Rails mailer edit_user_url uses http not https