Welcome Email

From GeeklogWiki
Revision as of 20:34, 25 March 2006 by Dirk (talk | contribs) (How to change the text of the welcome email)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The default text

Users registering an account with a Geeklog-powered site will get an email containing an automatically generated password that they have to use to log into the site. The standard text of that email is as follows:


Your Geeklog Site account has been created successfully. To be able to use it, you must login using the information below. Please save this mail for further reference.

User Name: yourname
Password: somepassword

This password is generated by a randomizer. It is recommended that you change this password immediately. To change your password, log in and then click Account Information from the User Functions menu.



Changing the language file

If you want to change the text of that message, then the simplest method is to edit Geeklog's language file, /path/to/geeklog/language/english.php (assuming English as your language), accordingly. The two sections of the above message are the strings #15 (Your ... account has been created successfully ...) and #14 (This password is generated ...), respectively, in the $LANG04 array.


Creating your own welcome email

Editing the language file as described above limits you to these two text sections (although they can be considerably longer than the original text, if you want to) which sometimes is just not flexible enough. Also, you'll have to make those changes again after every Geeklog update.

So, instead of using the built-in email message, you can create a simple text file that contains the text that you want to be sent to new users. That file has to be named welcome_email.txt and has to be placed in Geeklog's data directory, /path/to/geeklog/data.

In that text file, just add whatever you want to be contained in a message to a new user. To refer to the username and password, as well as your site's name and URL, you can use the following variables (i.e. these words in curly braces will be replaced with the proper information when the email is sent out):

variable contains
{auth_info} Username and password on two separate lines, just as in the original email.
{lang_text1} The first line of text, as in the original email (Your ... account has been created ...).
{lang_text2} The second line of text, as in the original email (This password is generated ...).
{lang_password} The word "password" in the current language.
{lang_username} The word "username" in the current language.
{password} The user's generated password.
{site_name} The name of your site, i.e. the value of $_CONF['site_name'] from your config.php.
{site_slogan} Your site's slogan, i.e. the value of $_CONF['site_slogan'] from your config.php.
{site_url} The URL of your site, i.e. the value of $_CONF['site_url'] from your config.php.
{username} The username, i.e. the short name that the user chose for their account when they signed up.


So your welcome_email.txt file could contain a message like this:


Hello {username},

thank you so much for signing up with {site_name}! We hope the site will be useful to you. Below is your username and password that you can use to log into the site:

{auth_info}

We recommend that you change your password once you've successfully logged into the site. Please use the following URL to change your password:

{site_url}/usersettings.php?mode=edit

Thanks again, {username}, for registering an account at {site_name} and we hope to hear from you soon.

regards,
The webmaster,
{site_url}


... or something like that. The welcome_email.txt makes it easy to change the text of that email, so you may want to change it more often, e.g. by adding a link to current site highlights, special offers, or things like that.