By Nick Klyne on Thursday, 20 February 2014
Posted in Technical Issues
Replies 5
Likes 0
Views 1.1K
Votes 0
Hi I hope you can help me...

I would like to set it so that when a notification is sent out the email includes the Category in the body of the email as well as the Avatar for that category...

How do I do this ?

Thanks

Nick
Hello Nick,

There is no setting to do that. However you can hack the file but it needs a several of edit here and there. Here are the files you might want to look around:
..\components\com_easydiscuss\helpers\helper.php line 2757 - 2759
..\components\com_easydiscuss\themes\simplistic\emails\email.subscription.site.new.html.php

Hope this helps.
·
Thursday, 20 February 2014 11:29
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Nik,

Helps in theory... but my PHP is very basic...

I find in the first file..

$emailData = array();
$emailData['postTitle'] = $emailPostTitle;
$emailData['postAuthor'] = $authorName;
$emailData['postAuthorAvatar'] = $authorAvatar;
$emailData['replyAuthor'] = $authorName;
$emailData['replyAuthorAvatar'] = $authorAvatar;
$emailData['comment'] = $post->content;
$emailData['postContent' ] = $post->trimEmail( $post->content );
$emailData['replyContent'] = $post->trimEmail( $post->content );

And I guess I either need to add aline for category to change the one for post Title... but what to ?

Also what I would like to do is have it be the Title of the Forum - Category instead of Title of the Forum.. At the top of the email content.

Thanks

Nick
·
Saturday, 22 February 2014 20:19
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Nick,

You might want to add these lines to get the category title:

$category = DiscussHelper::getTable( 'Category' );
$category->load($post->category_id);
$emailData['category'] = $category->title;


This line: $emailData['category'] = $category->title; will get you the category title. If you want directly change the Title to Category Title, you can replace it line with this: $emailData['postTitle'] = $category->title;. Therefore, you file will be like this:

$category = DiscussHelper::getTable( 'Category' );
$category->load($post->category_id);
$emailData = array();
$emailData['postTitle'] = $category->title;
$emailData['postAuthor'] = $authorName;
$emailData['postAuthorAvatar'] = $authorAvatar;
$emailData['replyAuthor'] = $authorName;
$emailData['replyAuthorAvatar'] = $authorAvatar;
$emailData['comment'] = $post->content;
$emailData['postContent' ] = $post->trimEmail( $post->content );
$emailData['replyContent'] = $post->trimEmail( $post->content );


Hope this helps.
·
Monday, 24 February 2014 11:09
·
0 Likes
·
0 Votes
·
0 Comments
·
still not working for me.,,,

I have this in the helper file now...
// prepare email content and information.
$category = DiscussHelper::getTable( 'Category' );
$category->load($post->category_id);
$emailData['category'] = $category->title;

$emailData = array();
$emailData['postTitle'] = $category->title;
$emailData['postAuthor'] = $authorName;
$emailData['postAuthorAvatar'] = $authorAvatar;
$emailData['replyAuthor'] = $authorName;
$emailData['replyAuthorAvatar'] = $authorAvatar;
$emailData['comment'] = $post->content;
$emailData['postContent' ] = $post->trimEmail( $post->content );
$emailData['replyContent'] = $post->trimEmail( $post->content );

I have included what i get below.... in the Grey were it say's Shadow Work Europe I want to see the category after it so it would be - Shadow Work Europe - Web Creation Team

Thanks

Nick
·
Sunday, 02 March 2014 08:42
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Nick,

I can't see your screenshot. Can you re-attach it? By the way, you might want to provide us your backend and FTP access so we can directly apply and test the hack for you.
·
Monday, 03 March 2014 09:35
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post