Change email template for Salted Hash Login Generator?


#1

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.


#2

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


#3

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?