MyBB Community Forums

Full Version: Email Notification Display
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have users on my forum that rely on viewing most of the threads via there email. This is the request I was given:

ModifiedNJ.com Wrote:here's something that has bothered me from day 1, just haven't really remembered to say something lol.

Email notifications for new posts and/or private messages show a preview area of the message/post. However, they don't show the entire message/post. Every forum I'm on includes the entire message/post in the email notification. Some people may not care, but I use instant email notifications for all subscribed threads and PM's. It's much easier to see what was said in my email (especially on my phone) than to have to navigate to the forums.

Can this be changed?


Quote:I agree especially for pm's.


Any way i can do this for them? Thanks in advance!
I'm afraid this requires a core modification.

Open inc/datahandlers/post.php and on line 913 comment out this line:
$excerpt = my_substr($excerpt, 0, $mybb->settings['subscribeexcerpt']).$lang->emailbit_viewthread;
So it looks like this:
//$excerpt = my_substr($excerpt, 0, $mybb->settings['subscribeexcerpt']).$lang->emailbit_viewthread;
On line 1334 change this line:
$excerpt = my_substr($thread['message'], 0, $mybb->settings['subscribeexcerpt']).$lang->emailbit_viewthread;
into
$excerpt = $thread['message'];
Ok will this make the change for PM's and Thread Email notifications? Just want to make sure im doing the correct thing. Especially when it means editing the code. Thanks for your very quick reply and detailed answer!
(2011-06-02, 03:16 PM)Ciggy Wrote: [ -> ]Ok will this make the change for PM's and Thread Email notifications? Just want to make sure im doing the correct thing. Especially when it means editing the code. Thanks for your very quick reply and detailed answer!

This is for the Thread Email notification.
How about editing the information contained in the email notification for a PM as well?
That's a little bit harder.

Open inc/languages/english/messages.lang.php and search for $l['email_newpm'], change it to:
$l['email_newpm'] = "{1},
		
You have received a new private message on {3} from {2}. To view this message, you can follow this link:

{4}/private.php

Subject: {5}
Message:
{6}

Please note that you will not receive any further notifications of new messages until you visit {3}.

You can disable new message notifications on your account options page:

{4}/usercp.php?action=options

Thank you,
{3} Staff
{4}";

Now open inc/datahandlers/pm.php and search for:
$emailmessage = $lang->sprintf($emailmessage, $recipient['username'], $pm['sender']['username'], $mybb->settings['bbname'], $mybb->settings['bburl']);
replace that with:
				require_once MYBB_ROOT.'inc/class_parser.php';
				$parser = new Postparser;
				
				$pm['subject'] = $parser->parse_badwords($pm['subject']);
				$pm['message'] = $parser->text_parse_message($pm['message'], array('me_username' => $pm['sender']['username'], 'filter_badwords' => 1, 'safe_html' => 1));
				
				$emailmessage = $lang->sprintf($emailmessage, $recipient['username'], $pm['sender']['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $pm['subject'], $pm['message']);

Thank you! Will attempt in a few minutes.