Forum: Ruby on Rails Change email template for Salted Hash Login Generator?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Gregory P. (Guest)
on 2006-01-26 19:18
There are a couple of things I'm trying to do with the salted hash login
generator.

First off I am trying to change the email template to include some other
things such as links to the site, instructions and other email goodness.

Second I am trying to find where the gem is pulling the app_url from
because I changed it to reference my host name, but I have not been able
to get it to use that - it keeps showing http://localhost:3000.
Ben M. (Guest)
on 2006-01-26 19:49
(Received via mailing list)
Gregory Pierce wrote:
> There are a couple of things I'm trying to do with the salted hash login
> generator.
>
> First off I am trying to change the email template to include some other
> things such as links to the site, instructions and other email goodness.
>
> Second I am trying to find where the gem is pulling the app_url from
> because I changed it to reference my host name, but I have not been able
> to get it to use that - it keeps showing http://localhost:3000.
>

I'm still working on figuring out a bunch of stuff with SHLG but I at
least know these...

1 - The generator creates an ActionMailer subclass in a user_notify.rb
file in models and
a bunch of rhtml templates in views/user_notify.

2 - It also creates a user_environment.rb file (in config/environments)
with a UserSystem
module and this has a bunch of configuration.

If you specified a different model name for your User (I did "Member"),
substitute that
name above accordingly.

b
Gregory P. (Guest)
on 2006-01-26 21:52
Thanks a bunch Ben. Found what I was looking for.

The only thing I still can't figure out is where the
http://locahost:3000/ keeps coming from. It seems to simply be ignoring
the value set in userEnvironment.rb which is set to

    # Sent in emails to users
    :app_url => 'http://www.mysite.com/',


It seems to just take the base URL of whereever the server happens to be
running. Not sure what's up with that.

  def signup(user, password, url=nil)
    setup_email(user)

    # Email header info
    @subject += "Welcome to #{UserSystem::CONFIG[:app_name]}!"

    # Email body substitutions
    @body["name"] = "#{user.firstname} #{user.lastname}"
    @body["login"] = user.login
    @body["password"] = password
    @body["url"] = url || UserSystem::CONFIG[:app_url].to_s
    @body["app_name"] = UserSystem::CONFIG[:app_name].to_s
  end

That block suggested that the url in the body would be replaced with
what's in UserSystem::CONFIG. Is there some other url that is being
created somewhere else that I need to find out how to change?
This topic is locked and can not be replied to.