By Steve Mayes on Tuesday, 13 March 2018
Posted in General Issues
Replies 2
Likes 0
Views 795
Votes 0
Hi,
Can i show the Category / Subcategory in the emails from Easyduscus?
Right now i see this:

New Question Posted
You have created a new discussion Problem in Subcategory Name

I want to say:


New Question Posted
You have created a new discussion Problem in Category Name / Subcategory Name
I found the ini file

COM_EASYDISCUSS_EMAILTEMPLATE_YOU_CREATED_NEW_DISCUSSION="You have created a new discussion <b>%1s</b> in <b>%2s</b>"

So what i need to add here to have the Category too?
·
Tuesday, 13 March 2018 22:20
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Steve,

You need to add this on 2 places. The first place is the language file of course but instead of modifying it, you need to add a new string,

[gist]
COM_EASYDISCUSS_EMAILTEMPLATE_YOU_CREATED_NEW_DISCUSSION_SUBCATEGORY="You have created a new discussion <b>%1$s</b> in <b>%2$s</b> / <b>%3$s</b>"
[/gist]

Then, you would also need to hack the e-mail template file in /components/com_easydiscuss/themes/wireframe/emails/email.post.new.html.php at line 22 where you need to change the codes below:

[gist]
<?php echo JText::sprintf('COM_EASYDISCUSS_EMAILTEMPLATE_YOU_CREATED_NEW_DISCUSSION', $postTitle, $postCategory); ?>
[/gist]

To,

[gist]
<?php
$category = ED::category($cat_id);

if ($category->isSubcategory()) {
$parent = ED::category($category->parent_id);

echo JText::sprintf('COM_EASYDISCUSS_EMAILTEMPLATE_YOU_CREATED_NEW_DISCUSSION_SUBCATEGORY', $postTitle, $parent->getTitle(), $postCategory);
} else {
echo JText::sprintf('COM_EASYDISCUSS_EMAILTEMPLATE_YOU_CREATED_NEW_DISCUSSION', $postTitle, $postCategory);
}
?>
[/gist]
·
Wednesday, 14 March 2018 01:00
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post