Sometimes, the welcome mail that Geeklog sends to new users (and which contains their username and password) is just not flexible enough. E.g. you may have some sort of promotion running and want to point new users to it. Or you just want to tell them more about the site in that mail.
Well, here is a simple hack for that problem ...
The idea is to use Geeklog's template class on a text file. This allows the use of variables, e.g. for the username and password as well as for the site name and URL. Other than that, it's just a simple text file you create which contains the email you want to send to new users.
All you need is a modified version of the function emailpassword()
from users.php
and the actual email file, which I put into /path/to/geeklog/plugins/welcome_email.txt
When the text file does not exist, Geeklog will send the standard email again. So you can simply delete (or rename) the file if you don't need it temporarily.
Have fun.
bye, Dirk
I originally suggested putting the welcome text into the language
directory. However, that is not a good place since it will then show up in your display preferences where you can select it as a language file ... So I've changed the story and the replacement emailpassword()
function to use the plugins
directory instead.
bye, Dirk
admin/user.php
) or when the user submission queue is enabled and you approve users from admin/moderation.php
, then it\'s still sending out the old message.
However, when new users register with the site via users.php?mode=new
(and the user submission queue is off), then they should get the new message.
bye, Dirk function moderateusers()
in admin/moderation.php is very similar to that of function emailpassword()
.
If you replace the part that starts with $mailtext = \"{$LANG04[15]}\\n\\n\";
and ends with $mailtext .= \"{$_CONF[\'site_url\']}\\n\";
with the if (file_exist ...) ... else ...
block from the hacked emailpassword()
function it should work (I think - haven\'t tested it).
bye, Dirk