Hi, is it possible to set different email templates for the jomsocial emails?
I started creating an email template override and I noticed in the jomsocial email template the variable $email_type
which I could then use to detect which email is being sent and present my custom design. However the $email_type returns undefined.
Can someone point me in the right direction on how to set different email templates?
Thanks
Hi, Sarah.
You mean different email template for each email?
There is a base email file:
ROOT/components/com_community/templates/jomsocial/layouts/email.html.php
Which allows you to customize email alyout.
There are also dozens of other files that are loaded inside main email template... you may try to customize tem as well.
Is seems that there is only one email type $email_type = 'etype_friends_invite_users' other are undefined.
HI Michal,
Thanks for that.
There is no template/layout for the welcome email neither for the account details/activation email.
Do you know where I can find those? Is there a way to differentiate what is being sent?
Thanks
HI, Sarah.
Activate account email content is taken from Joomla! as in a fact when registering in JomSocial you create Joomla! account which (if set so) must be activated. In such a case variable $content in email.html.php loads Joomla! langauge constant COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY
So there is only one template but loads different content. If you want to customize content, then you need to override language constants or - in case of JS emails - child email template e.g email.profile.wallcomment.html.php.
No, there is no way to way to differentiate what is being sent except $email_type = 'etype_friends_invite_users'
Hi again Michal,
I think my idea above didn't quite solve my problem and Jomsocial language override seems to not accept html markup.
I added a couple of divs and a table to the constant COM_COMMUNITY_EMAIL_REGISTRATION_ACCOUNT_DETAILS
But when the welcome email comes through it seems to remove the entire html
Can you confirm it is the correct behavior?
Thanks
Seems to me Tables and Divs are not accepted in the account activation and register language override values.
So instead I checked the requested taks in the email.html.php to present the user with a different template for the registration and the activation email.
<?php if(JFactory::getApplication()->input->get('task') =='register_save'){ ?>
Welcome Email template
<?php } ?>
or
<?php if(JFactory::getApplication()->input->get('task') =='registerUpdateProfile'){ ?>
Activate your account Template
<?php } ?>
Thanks