30

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.

m33lky
  • 7,055
  • 9
  • 41
  • 48

1 Answers1

69

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

Community
  • 1
  • 1
benrugg
  • 2,088
  • 1
  • 16
  • 8