Nutty Hiker
Nutty Hiker

Reputation: 163

Rails mailer edit_user_url uses http not https

My entire app is https, no http.

If add the following to any of the views

I get a "edit user" linked to

https://localhost:3000/user/2/edit

But when I place the same line in a mailer view the email contains

http://localhost:3000/user/2/edit

Notice the "http" instead of "https"??

Using

rails 3.0.5 and ruby 1.8.7

Upvotes: 16

Views: 4306

Answers (2)

tacos1998
tacos1998

Reputation: 21

Editing my config/environments/development file with

host = "hostaddress.io"    
config.action_mailer.default_url_options = { host: host, protocol: 'https' }

worked for me on Rails 4.2.2.

Upvotes: 2

Roman
Roman

Reputation: 13058

I believe that you have to put in your config/environments/production.rb:

config.action_mailer.default_url_options = {:protocol => 'https'}

Upvotes: 45

Related Questions