Hi Community Folks,
I have a scenario in which I have to pass some custom data based on user's properties to welcome email template in nodebb. How can I achieve this ?
Feedback appreciated
Thanks
If you have a custom theme please add the app.template property in your header.tpl.
Here is a sample from lavender.
<script>
var RELATIVE_PATH = "{relative_path}";
var config = JSON.parse('{configJSON}');
var app = {
template: "{template.name}"
};
app.user = JSON.parse('{userJSON}');
</script>
https://github.com/NodeBB/nodebb-theme-lavender/blob/master/templates/header.tpl#L20-L27
app.template
will give the current template the user is on and is updated as the user ajaxifies around the site.
In my case, my theme doesn't depend on Vanilla or any other theme. Does this matter? I have like all custom templates 30+ partials.
And I'm having problems calling the {name} variable in category.tpl
Could this have anything to do with it? I did add the code above by the way as well.