News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Modification of registration email text

Started by jrallen01, May 30, 2004, 08:58:10 AM

Previous topic - Next topic

jrallen01

Where can I modify the text of the registration email that is sent out. I have looked in registration.php and can't locate the text. I also can't find any administrative function to do this.

Thanks in advance.

Daniel D.

What about searching in the other files? ::) Man, this can't be true...

Oldiesmann

Try Themes/default/languages/Login.english.php - that file contains all kinds of text strings dealing with registration, so it's probably in there someplace.
Michael Eshom
Christian Metal Fans

graham

Hmmm...

I was trying to do this also and imagined that it would be as easy as most of the admin tasks on SMF such as editing the registration agreement or the forum news however the only way I could find of doing it was to edit the Login.english.php and Register.php files. ( ::) Man, this can't be true)

The Login.english.php file contains the text like this:


$txt[700] = 'Welcome to';
$txt[701] = 'You may change it after you login by going to the profile page, or by visiting this page after you login:';
$txt[719] = 'Your username is: ';
$txt[730] = 'That email address (%s) is being used by a registered member already. If you feel this is a mistake, go to the login page and use the password reminder with that address.';


and this is the file that you need to add your new text

The Register.php file is what actually constructs and sends the mail and does it by calling the appropriate text by its number (from what I can tell anyway), like this:


if (isset($_POST['emailActivate']))
sendmail($_POST['email'], $txt[700] . ' ' . $context['forum_name'],
"$txt[hello_guest] $_POST[user]!\n\n" .
"$txt[719] $_POST[user], $txt[492] $_POST[password]\n\n" .
"$txt[activate_mail]:\n\n" .
"$scripturl?action=activate;u=$memberID;code=$password\n\n" .
"$txt[activate_code]: $password\n\n" .
$txt[130]);


Personally I think this method is a bit of a let down compared to the rest of the admin functions of SMF and means that newbies have to delve into the scripts each time something needs changing. Would be great to see this functionality as part of future releases of the administrative tools.

[Unknown]

It's already simplified in 1.1, although it's still in the language files:

// For the below three messages, %1$s is the username, %2$s is the password, %3$s is the activation code, and %4$s is the activation link (the last two are only for activation.)
$txt['register_immediate_message'] = 'You are now registered with an account at ' . $context['forum_name'] . ', %1$s!' . "\n\n" . 'Your account\'s username is %1$s and its password is %2$s.' . "\n\n" . 'You may change your password after you login by going to your profile, or by visiting this page after you login:' . "\n\n" . $scripturl . '?action=profile' . "\n\n" . $txt[130];
$txt['register_activate_message'] = 'You are now registered with an account at ' . $context['forum_name'] . ', %1$s!' . "\n\n" . 'Your account\'s username is %1$s and its password is %2$s (which can be changed later.)' . "\n\n" . 'Before you can login, you first need to activate your account. To do so, please follow this link:' . "\n\n" . '%4$s' . "\n\n" . 'Should you have any problems with activation, please use the code "%3$s".' . "\n\n" . $txt[130];
$txt['register_pending_message'] = 'Your registration request at ' . $context['forum_name'] . ' has been received, %1$s.' . "\n\n" . 'The username you registered with was %1$s and the password was %2$s.' . "\n\n" . 'Before you can login and start using the forum, your request will be reviewed and approved.  When this happens, you will receive another email from this address.' . "\n\n" . $txt[130];


This also makes it levels easier to translate.

-[Unknown]

bollywhat

Unknown, where in the language files is the code you're quoting? 

saw

Oddly enough, some of the text in the notification email (e.g., the closing 'Regards, the xxx Team') doesn't seem to be in Login.english.php. Where is it coming from?

Oldiesmann

bolly - that's from 1.1, which is the next major version. You'll have to wait a while for that.
saw - index.english.php, line 96
Michael Eshom
Christian Metal Fans

saw

thanks, Oliesmann.

What I'd like to do is write a new closing, replacing that entire test string. How do I do that, adding line breaks?

[Unknown]

Quote from: saw on January 08, 2005, 05:09:31 PM
thanks, Oliesmann.

What I'd like to do is write a new closing, replacing that entire test string. How do I do that, adding line breaks?

Just replace the old closing.  You can add breaks by using "\n" - in quotes... like this:

'So long,' . "\n" . 'Farewell,' . "\n" . 'And thanks for all the fish.';

-[Unknown]

groovie

QuoteYou can add breaks by using "\n" - in quotes... like this:

'So long,' . "\n" . 'Farewell,' . "\n" . 'And thanks for all the fish.';

hello , i am trying to add break using the above method and it isnt working.  i have tried a few alternatives as well. 

now i have this in login.english.php:

'Once you have logged in you can start posting messages in the forum or photos within the gallery.  If there are new categories you would like to see in either, just left us know and we will set them up ready for you to post in.  "\n" . Including the country you are from in your public profile..........'

and there is no break in the welcome mail, rather it shows this:

...just left us know and we will set them up ready for you to post in.  "n" . Including the country you are from...

any ideas anyone.

thank you :)


[Unknown]

'Once you have logged in you can start posting messages in the forum or photos within the gallery.  If there are new categories you would like to see in either, just left us know and we will set them up ready for you to post in.' . "\n" . 'Including the country you are from in your public profile..........'

-[Unknown]

groovie

thanks heaps...

um was trying to add two of the n's and when i tried to login , (i had been logging in and out with various users to test the welcome email), i got this error:

Template Parse Error!
It seems something has gone sour on the forum with the template system. This problem should only be temporary, so please come back later and try again. If you continue to see this message, please contact the administrator.

You can also try refreshing this page.

any ideas?  i suppose i should start a new topic

ps i tried logging in with a few users , not just admin and it did the same thing , i am using firefox and have deleted cache and cookies etc. 

groovie

its fixed , i'll tell u how in a sec, dont want u typing for no reason

groovie

ok so this is what i did...

i dont know if it just needed time or it was related to some code in login.english.php...

could u please clarify - i would like to add a full line break , therefore do i add two n's and if so how?  Below is what i had in my login.english.php which may or may not have caused my site to freak, is this ok?

'Once you have logged in you can start posting messages in the forum or photos within the gallery.  If there are new categories you would like to see in either, just left us know and we will set them up ready for you to post in.' . "\n" .. "\n" . 'Including the country you are from in your public profile..........'

i have removed that now and just have one 'n' thing.

thanks again :)

[Unknown]

Use "\n\n".  So:

post in.' . "\n\n" . 'Including

-[Unknown]

groovie


Snickers

Quote$txt['register_activate_message'] = 'You are now registered with an account at ' . $context['forum_name'] . ', %1$s!' . "\n\n" . 'Your account\'s username is %1$s and its password is %2$s (which can be changed later.)' . "\n\n" . 'Before you can login, you first need to activate your account. To do so, please follow this link:' . "\n\n" . '%4$s' . "\n\n" . 'Should you have any problems with activation, please use the code "%3$s".' . "\n\n" . $txt[130] (If that doesn't work, please email the webmaster: [email protected])' . "\n\n" . ' ' . "\n\n" . 'You should add an avatar and input forumprofile details, as soon as you log in. This can be done in your profile: http://www.*****.com/index.php?action=profile;u=1;sa=forumProfile ' . "\n\n" . ' Also, please read the rules before you start posting: http://www.*****.com/index.php/topic,2.0.html' . "\n\n" . ' ' . "\n\n" . ' ' . "\n\n" . 'Anyway, Welcome! We hope to see your posts on the board! ' . "\n\n" . ' "\n\n" . $txt[130];

what did I do wrong? (it says error)

and does it sound okay?

Snickers

I found all the ' . ' N things confusing, so I probably misplaced some :(


Advertisement: