# Change email template for Salted Hash Login Generator?

**URL:** <https://www.ruby-forum.com/t/change-email-template-for-salted-hash-login-generator/97699>\
**Category:** Rails\
**Created:** [January 26, 2006, 6:18pm UTC](https://www.ruby-forum.com/t/change-email-template-for-salted-hash-login-generator/97699 "2006-01-26T18:18:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gpierce](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/90ced4/32.png) [@gpierce](https://www.ruby-forum.com/u/gpierce)\
**Post date:** [January 26, 2006, 6:18pm UTC](https://www.ruby-forum.com/t/change-email-template-for-salted-hash-login-generator/97699/1 "2006-01-26T18:18:58Z")

</div>

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](http://localhost:3000).

---

<div class="post-metadata">

**Author:** ![gpierce](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/90ced4/32.png) [@gpierce](https://www.ruby-forum.com/u/gpierce)\
**Post date:** [January 26, 2006, 6:49pm UTC](https://www.ruby-forum.com/t/change-email-template-for-salted-hash-login-generator/97699/2 "2006-01-26T18:49:10Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![gpierce](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/90ced4/32.png) [@gpierce](https://www.ruby-forum.com/u/gpierce)\
**Post date:** [January 26, 2006, 8:52pm UTC](https://www.ruby-forum.com/t/change-email-template-for-salted-hash-login-generator/97699/3 "2006-01-26T20:52:52Z")

</div>

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/](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?
