Vanilla open source was terminated 1 January 2025 by Higher Logic. See this announcement for more information.
Problem with "Welcome Aboard" e-mail being empty in 2.1b1?

I have just added a user manually in the dashboard, who then got the following e-mail:
Subject: [_Forum Title_] Welcome Aboard! Body: EmailWelcome
I have created a new locale en-US using the skeleton folder, enabled it in the dashboard and set it to be the default. My locale's definition.php only has some override entries with modified text I'm using (like for TermsOfService and PrivacyPolicy).
The default text for EmailWelcome is in applications/dashboard/locale/en-CA/definitions.php
which is used by applications/dashboard/models/class.usermodel.php
as
// Check for the new email format. if (($EmailFormat = T("EmailWelcome{$RegisterType}", '#')) != '#') { $Message = FormatString($EmailFormat, $Data); } else { $Message = sprintf( T('EmailWelcome'), $User->Name, $Sender->Name, $AppTitle, ExternalUrl('/'), $Password, $User->Email ); }
What's possibly wrong here?
0
Comments
What is the definition you are using for 'EmailWelcome{$RegisterType}' and 'EmailWelcome'?
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 don't have any such definitions in my custom
locales/en-US/definitions.php
as I thought the default ones are being used if I don't assign my own. Looks like I'm wrong, although the default ones are inapplications/dashboard/locale/en-CA/definitions.php
?Alrighty. When you add a user through the dashboard, the $Register type is 'Add'. Which means you need to have a definition for 'EmailWelcomeAdd', otherwise it uses the default 'EmailWelcome' definition.
It looks to me like there is no definition loading for 'EmailWelcome', since the body text is just 'EmailWelcome'.
The Forum Title is the default config for 'Garden.Title'. Open your
/conf/config.php
file and see if you have it set in there.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.
@hgtonight
There is no default definition for 'EmailWelcomeAdd', but the default definition for 'EmailWelcome' is in
applications/dashboard/locale/en-CA/definitions.php
and it's the correct text for registration type 'Add':So why is it not used then? If everything is in place and properly working, it should not send an e-mail with just 'EmailWelcome' in the body.
I'm worried that other e-mails the system sends are incomplete as well.
Forum Title is properly shown in the e-mail's subject, I've just edited to be generic for my initial comment here on this forum.
@hgtonight
Do I have to copy
applications/dashboard/locale/en-CA/definitions.php
toapplications/dashboard/locale/en-US/definitions.php
?(as I have sent en-US as default, and my en-US definitions.php in locales/en-US only contains the few defintions I've added or changed)
'EmailWelcomAdd' does not exist as a default definition. The user model code takes into account not having a default and executes the else conditional that you linked.
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.
@hgtonight
Yes, that's not the problem, the problem is that the text for "EmailWelcome" is defined in
applications/dashboard/locale/en-CA/definitions.php
but not shown in the actual welcome e-mail, as if the default definition is not found by that user model code.It may have something to do with the locale setting as mentioned above, but on the other hand all other default language definitions seem to be found although I switched to "en-US".
I am confused as too your issue.
Perhaps you could restate it?
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.
Ok, I'll try again:
The default language definition for "EmailWelcome" is in
applications/dashboard/locale/en-CA/definitions.php
.The user model code is supposed to fetch that default language definition to use it in the welcome e-mail.
Nevertheless the e-mail just shows "EmailWelcome" in the body, which means the user model code did not find / use that default language definition from
applications/dashboard/locale/en-CA/definitions.php
.My default language is set to "en-US" which I created by copying
locale/skeleton
tolocale/en-US
, and I only put my additional language definitions and text I modified inlocale/en-US/definitions.php
, as I thought what's not defined in mylocale/en-US/definitions.php
will be fetched from the default language definition file, which I though wasapplications/dashboard/locale/en-CA/definitions.php
.Does that make any sense?
If setting a new default locale (in my case "en-US") means, that
applications/dashboard/locale/en-CA/definitions.php
is not used any more, should Iapplications/dashboard/locale/en-CA/definitions.php
toapplications/dashboard/locale/en-US/definitions.php
and leave just my additions/overrides inlocale/en-US/definitions.php
or
applications/dashboard/locale/en-CA/definitions.php
tolocale/en-US/definitions.php
and make my changes/addition in that file?
I'm confused on how that localization is supposed to work, and I don't understand why the default locale is "en-CA", which is quite uncommon (it's even hardcoded in the default template of 2.0.x below DOCTYPE, as well as in the mobile theme of 2.1b1).
Alright. I am pretty sure I understand the issue. Changing the locale to
en-US
will only load definitions from that language locale. This means it will not load the definitions fromapplications/dashboard/locale/en-CA/definitions.php
.If all you want to do is replace some of the default text, you should place those definitions in
/conf/locale.php
./locales
should only be used for full translations.The default locale is
en-CA
since that is the local locale for the Vanilla devs (that are based out of Canada).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.
@hgtonight
Now I understand! I have just moved
locale/en-US/definitions.php
to/conf/locale.php
, madeen-CA
the default language again, and everything should be working now as supposed to.