Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
How to Remove the Forum Title from Email Subject Lines?
pwolfe
New
Is there a simple way to remove the [ Forum Title ] that appears in brackets in ALL the emails that are sent to new registered users and for email confirmation, password resets etc.??
Tagged:
0
Comments
Not very simple, but also not too hard
First you have to create a custom localization: http://vanillaforums.org/docs/localization. That's easy. (But don't forget to delete the .ini files in your cache folder after each time you've changed your custom locale file!)
Afterwards you have to find the strings you want to "translate". If you want to change the mails that are sent whenever a user is concerned, you might want to look at
applications/dashboard/models/class.usermodel.php
.Finding the right file is the harder part. Doing a search for some other part of the mail title than the forum title name could help.
In the UserModel there is for example that line:
$Email->Subject(sprintf(T('[%s] Password Reset'), $AppTitle));
. Whenever you find T("...") in the code, you can add a custom translation in your locale file. Here it would be$Definition['[%s] Password Reset'] = 'Nice Password Reset Mail Title';
. That again is easy.You don't have to create a whole locale pack to customize strings. Just paste your definitions in the
/conf/locale.php
file. If that file doesn't exist, create it. You can get more information here: http://vanillawiki.homebrewforums.net/index.php/Locales@R_J You should only have to refresh the locale map when you are adding new locale files. Changes in the files should take effect immediately (excepting any caching system you have in place). On the other hand, it doesn't really hurt anything either.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
I changed 3 definitions in the "definitions.php" file in the following directory and that seemed to do the trick:
applications > dashboard > locale > en-CA
$Definition['[%s] Welcome Aboard!'] = 'Registration Information';
$Definition['[%s] Confirm Your Email Address'] = 'Confirm Your Email Address';
$Definition['[%s] Password Reset Request'] = 'Password Reset Request';
Are there any other ones that I am missing?
@pwolfe You should never modify core files. Locales were designed to be easily changed via definitions. Create a new file at
/conf/locale.php
and put any custom definitions in there. For example:But why shouldn't I modify the core files?
Every core modification:
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Okay thanks. I have reverted the "definitions.php" file back to its original and made the changes the the locale.php file instead. It is working, but I have a couple of other "core" files that I modified text in: "class.guestmodule.php" and "emailconfirm.php"
In the "class.guestmodule.php" file, I would like to change the following default text:
"It looks like you're new here. If you want to get involved, click one of these buttons!"
In the "emailconfirm.php" file, I would like to change this text and add a URL below it:
"Your email has been successfully confirmed."
Is there a way to change this text in the "locale.php" file as well? I had some problems customizing this text going the locale.php route, but it worked when I changed it within the actual files themselves.
Please download a locale for another language. Something like spanish. It lists almost every definition there is without having to search.
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
Any text passed through the
T()
method can be overwritten via locale definitions.Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Thanks for the tips. Those locale definitions work better and it's nice having all the settings set in one file.