[devise] How to change confirmation_url for confirmable?

693 views
Skip to first unread message

tadatoshi

unread,
May 2, 2010, 11:55:28 PM5/2/10
to Devise
Hi,

I'm using confirmable and in the confirmation e-mail, the generated
link "Confirm my account" is always pointing to "localhost:3000" even
in the production mode. How can I configure to make it point to the
production domain name?

Thank you in advance.

Tadatoshi

Cyril Mougel

unread,
May 3, 2010, 4:14:48 AM5/3/10
to plataforma...@googlegroups.com
On Mon, May 3, 2010 at 5:55 AM, tadatoshi
<tadatoshi....@gmail.com> wrote:
> Hi,
>
> I'm using confirmable and in the confirmation e-mail, the generated
> link "Confirm my account" is always pointing to "localhost:3000" even
> in the production mode. How can I configure to make it point to the
> production domain name?
>

You need define the host in your ActionMailer configuration

config.action_mailer.default_url_options = { :host => 'localhost:3000' }



--
Cyril Mougel
http://blog.shingara.fr

tadatoshi

unread,
May 5, 2010, 11:35:36 AM5/5/10
to Devise
Hi, Cyril,

Thank you for your reply.

The problem happened even after I set the host in
config.action_mailer.default_url_options to the actual production
domain name.
I set it in config/environments/production.rb

By the way, how does it relate to the link put in the confirmation e-
mail?
The confirmation e-mail generated looks like this:
----------------------------------------------------------------------
Welcome ...@...!

You can confirm your account through the link below:

Confirm my account
----------------------------------------------------------------------
The link I'm talking about is "Confirm my account" above.
To me, it doesn't seem to have anything to do with ActionMailer
configuration.

Any further help will be greatly appreciated.

Sincerely,
Tadatoshi


On May 3, 4:14 am, Cyril Mougel <cyril.mou...@gmail.com> wrote:
> On Mon, May 3, 2010 at 5:55 AM, tadatoshi
>

tadatoshi

unread,
May 10, 2010, 1:23:59 PM5/10/10
to Devise
Sorry for the delay to write update.

It turned out that what was set in an initializer was overwriting the
one under environments directory.
I followed Railscasts Episode 206 "Action Mailer in Rails 3" and
Episodes 209 and 210 for Devise.
And the ActionMailer setting put in initializers/setup_mail.rb
following the Episode 206 was overwriting the one following Episode
209.

Thank you again, Cyril and everybody who might kindly have looked at
this post.

Sincerely,
Tadatoshi
Reply all
Reply to author
Forward
0 new messages