PDA

View Full Version : How do I put full text in forum notifications?


joyfulmiller
09-11-2009, 01:03 PM
I'm interested in putting the full forum post text in each forum notification email that members receive. This would be for all new posts, not just posts/threads the member has started or replied to.

I'm not interested in allowing members to reply by email (I already tried the email integration mod and it didn't work), only in members being able to read the full text of each post in their email. Having hits on my forum is not important at all. Having members easily read all the new/updated forum posts is the priority.

Is there a template modification that can be done to insert the full text of posts into the notification emails? I know full text is included in emails notifications for subscribed threads, so it must be possible somehow.

We are currently using vBulletin 3.8.3.

Thanks.

Lynne
09-11-2009, 02:08 PM
Are you talking about the Daily Digest or what?

joyfulmiller
09-11-2009, 02:29 PM
Yes, when someone subscribes through Forum Tools to daily or weekly digests, I need to be able to include the full text of the posts in the email notifications instead of just the title, author, and link to the post on the forum.

Lynne
09-11-2009, 02:43 PM
The phrase for the digestpostbit is this:
************
$post[title]
$vboptions[bburl]/showthread.php?p=$post[postid]#post$post[postid]
Posted by: $post[postusername]
On: $post[postdate] $post[posttime]

$post[pagetext]

So, you should be sending out the pagetext. Exactly what is being sent out?

joyfulmiller
09-11-2009, 02:57 PM
This is an example of contents of the notification email that is received by members who have subscribed to Daily Digest of forums:

###

Dear John Doe,

You are subscribed to the forum General Discussion, there have been 4 new thread(s) and 5 updated thread(s).
http://mysite.org/members/forum/forumdisplay.php?f=13

The following threads are new:
************
Library update and thoughts on new forum
http://mysite.org/members/forum/showthread.php?t=99
In forum: General Discussion
Started by: M Smith
Last post: 09-10-2009 09:55 AM
************
Where to shop?
http://mysite.org/members/forum/showthread.php?t=100
In forum: Local Recommendations
Started by: E Crownover
Last post: 09-10-2009 11:11 AM
************

So as you see, it includes just the Title, the Link, the Forum Category, the Author, and the Post Date. No full text at all.

Lynne
09-11-2009, 05:00 PM
That is for when users are subscribed to a forum, not a particular thread. The post text is not grabbed in the query for the forum subscriptions and there are no hooks available. That means you will have to modify the actual query to grab the post text and then modify the code to parse it for the email and then modify the phrase to spit it out. The query is around line 204 in includes/functions_digest.php. I think you'll need to JOIN the post table in order to get the post text of the first post (I assume that is all you are wanting to grab).

joyfulmiller
09-11-2009, 05:17 PM
Are there more specific instructions that you could give me to modify the code? I am a newbie and coding and I'm afraid I couldn't figure it out on my own.

Would this also put the text of the Updated Posts in the digest in addition to the text for the New Posts?

Lynne
09-11-2009, 05:37 PM
I believe forum digests only go out for new threads that are posted in a forum. So, if there are new posts to a thread in a forum, these will not be included in the digest.

As for what to add... I've never done what you want to do, so I can't really give you specifics. But, the query I pointed out is, I think, the one you need to modify to grab the first post text at the same time as it grabs the other info. You need to add a join, something like:
INNER JOIN " . TABLE_PREFIX . "post AS post ON(thread.firstpostid=post.postid)And then in the SELCT part of the statement, you need to add in "post.pagetext". That should grab the pagetest of the first post in the thread for you. Then you need to do something with it. In the code above the query you are modifying, the post text is selected, and then they do this to it to get it ready for the email output:
$post['pagetext'] = $plaintext_parser->parse($post['pagetext'], $thread['forumid']);So, you may need to add that to your code before you then try to insert it into your phrase (with different variable names, of course).... you will have to modify that phrase also - digestthreadbit ?

I would suggest you play with this on your test site.

joyfulmiller
09-18-2009, 01:43 AM
Is there anyone else that can give me more specific instruction for how to do this? I can find the right place in the file that was referred to in the last post, but I still don't know exactly what code I need to put where. Please help?