Log in

View Full Version : New Feature: If you turn PM notification email to ON, you get new PMs emailed to you!


Erwin
04-14-2003, 10:31 AM
Try it.

Switch "Send you an email when you receive a Private Message?" to YES.

Each time you get a new PM, you will get the contents of the whole PM emailed to you. Click on the link in the PM to go directly to the PM and make a Quick Reply.

Convenient... :)

Tony G
04-14-2003, 11:19 AM
Convienient indeed, nice addition Erwin. :)

filburt1
04-14-2003, 12:32 PM
Has anybody released this? If not I'll write it.

amykhar
04-14-2003, 01:25 PM
What's to write? You just put $message in the emailsubject_pmreceived template. ;)

Amy

filburt1
04-14-2003, 02:16 PM
I thought it wasn't in there already :)

Erwin
04-14-2003, 11:25 PM
LOL! Amy is right, it's just a template mod. :)

filburt1
04-14-2003, 11:28 PM
Today at 08:19 PM Erwin said this in Post #7 (https://vborg.vbsupport.ru/showthread.php?postid=382274#post382274)
LOL! Amy is right, it's just a template mod. :)


Makes me wonder then why vB would go through the trouble of getting the contents of the message when it never is even displayed...

BTW you might want to strip vB code from the messages, it's somewhat awkward to read. :)

Boofo
04-15-2003, 11:26 AM
Yesterday at 07:22 PM filburt1 said this in Post #7 (https://vborg.vbsupport.ru/showthread.php?postid=382276#post382276)
Makes me wonder then why vB would go through the trouble of getting the contents of the message when it never is even displayed...

BTW you might want to strip vB code from the messages, it's somewhat awkward to read. :)

How would you do this?

majin gotenks
04-15-2003, 11:31 AM
would be good if you could make it replace it with html instead :)

Xenon
04-15-2003, 11:47 AM
hmm, you have to bbcodeparse it then before sending the mail ;)

i don't use e-mail for pm at all *gg*
but nice edit Erwin.

Erwin
04-15-2003, 12:18 PM
Yesterday at 11:25 PM majin gotenks said this in Post #12 (https://vborg.vbsupport.ru/showthread.php?postid=382439#post382439)
would be good if you could make it replace it with html instead :)

Done - stripped bbcode, and converted to a HTML email.

So you get the whole PM message as it would look like in your PM inbox on vB.org, without the colors and frills.

Tony G
04-15-2003, 12:57 PM
Oooh, now I gotta try it. :)

Boofo
04-15-2003, 01:31 PM
Will someone be releasing this as a hack, by chance?

filburt1
04-15-2003, 01:43 PM
As Amy says it's apparently just a template mod.

Boofo
04-15-2003, 01:56 PM
But what about stripping the vbcode?

TECK
04-15-2003, 03:15 PM
I posted a fix for this in the hack thread...

Erwin
04-15-2003, 09:25 PM
Today at 01:56 AM Boofo said this in Post #18 (https://vborg.vbsupport.ru/showthread.php?postid=382489#post382489)
But what about stripping the vbcode?

The vBcode is converted into HTML, and sent to you.

Erwin
04-15-2003, 09:26 PM
Today at 03:15 AM TECK said this in Post #20 (https://vborg.vbsupport.ru/showthread.php?postid=382525#post382525)
I posted a fix for this in the hack thread...

What fix?

I'm not really stripping vBcode, just converting it into HTML and then sending it.

And this is no longer just a template mod, it's a hack, just 2 extra lines in private.php.

Boofo
04-15-2003, 09:36 PM
Do we still have the text option or will it only ne html now? It really doesn't matter to me but there are some who will want text over html.

Erwin
04-15-2003, 09:37 PM
I'm not making any changes to the database until vB3 gets here, so there is no option - if the email does not support HTML, the member can still click on the link to go directly to the actual PM.

nuno
04-16-2003, 05:12 AM
Nice addition guys, thanks! :bunny:

majin gotenks
04-16-2003, 11:04 AM
sounds good. can someone please pm me so i can see how it looks? thanks :)

Gary King
04-16-2003, 02:10 PM
Nice addition erwin, good job!

Kars10
04-21-2003, 02:17 PM
@ Erwin, can you release this hack please?

Thanks in advance
Kars

bharvey42
04-21-2003, 05:36 PM
Cool this is exactly what i am looking for thanks.

Is there going to be a full hack released for this?

Smoothie
05-14-2003, 05:06 PM
Any plans on the full hack being released?

Erwin
05-15-2003, 01:16 AM
At the moment, it's not a hack. :) It's just a template mod.

Just add $message into your email_pmreceived template.

Linking directly to the PM is a hack that has been released here already.

Smoothie
05-15-2003, 02:03 AM
04-15-03 at 06:26 PM Erwin said this in Post #18 (https://vborg.vbsupport.ru/showthread.php?postid=382708#post382708)
What fix?

I'm not really stripping vBcode, just converting it into HTML and then sending it.

And this is no longer just a template mod, it's a hack, just 2 extra lines in private.php. Whats this? Can you release this? Thats what I was referring to...

Erwin
05-15-2003, 02:25 AM
The HTML version? If you really want it, I will find time to release it. :)

Boofo
05-15-2003, 11:01 AM
Smoothie, if you really want html for pms, Logician made a hack a while back that allows the user to pick whether he wants text of html pms in his modify options.

Smoothie
05-15-2003, 05:12 PM
Erwin and Boofo,

thanks, I just used part of this hack, and the one with the links for the pm in the email.

filburt1
05-15-2003, 05:15 PM
Might want to add an option in the user CP such that if you receive fulltext PMs via e-mail that they should be marked read by default :)

Smoothie
05-15-2003, 05:24 PM
Today at 02:15 PM filburt1 said this in Post #32 (https://vborg.vbsupport.ru/showthread.php?postid=395498#post395498)
Might want to add an option in the user CP such that if you receive fulltext PMs via e-mail that they should be marked read by default :) good iidea.

Boofo
05-15-2003, 10:59 PM
How would you do that? Sounds like a good idea.

Erwin
05-16-2003, 03:31 AM
Good idea filburt1. When I have time I would do it here.

Boofo
05-16-2003, 03:40 AM
Would you post it here when you do it?

Erwin
05-17-2003, 01:20 AM
I think I may have done this... can someone PM me so that I can check...

Boofo
05-17-2003, 01:27 AM
I'm getting a db error when I try to pm you.

Erwin
05-17-2003, 02:04 AM
Mmm... code removed... the dateline is interfering with the PM popup global.php code... need to tweak this...

filburt1
05-17-2003, 02:18 AM
$id = $DB_site->insert_id(); // or last_insert_id(), can't remember

It's a standard PHP function, too (http://www.php.net/mysql_insert_id).

Erwin
05-17-2003, 03:19 AM
Can't believe I missed it - thanks filburt1.

Okay, to make it so that if the "PM Email notification" is ON, the PM is automatically made READ when the Email is sent to you, do this:

Open private.php, find:


// enhanced
if ($prevmessageid) {


Above it, add:


$the_pm_id = $DB_site->insert_id();


Those who installed the direct PM link will have the above line already from that hack.

Then, find:


if ($touserinfo[emailonpm]) {


Underneath, add:


$DB_site->query("UPDATE privatemessage SET messageread=1, readtime='".time()."', receipt=2 WHERE privatemessageid=$the_pm_id");


Done.

This hack may interfere with other PM hacks. I've had to modify global.php as well. I hope it is all working now.

Boofo
05-17-2003, 03:21 AM
What did you modify in the global.php?

Boofo
05-17-2003, 03:24 AM
Isn't your code above the same code that was in the first message you posted it in?

Erwin
05-17-2003, 03:27 AM
Basically, if you have the direct PM link hack installed, this mod interferes with it. So I disabled the PM popup code when you access private.php (which you don't need anyway since you are looking at your PMs).

You find this in global.php:


if ($hack_pm_total > 1) {


Above this, add:


if (strpos($_SERVER['PHP_SELF'], "private.php" ) == false) {


Then, find:


eval("\$headnewpm = \"".gettemplate('head_newpm')."\";");


Below this, add:



}



The PM code will not show up when you are at private.php, preventing the 2 hacks from interfering with each other.

Erwin
05-17-2003, 03:28 AM
Today at 02:24 PM Boofo said this in Post #48 (https://vborg.vbsupport.ru/showthread.php?postid=396016#post396016)
Isn't your code above the same code that was in the first message you posted it in?

Yes, it was. :) I took it out because I had to fix the global.php error, but put it back, when I realized the easier way to do it was keep the code the same, and just modify global.php.

Boofo
05-17-2003, 03:35 AM
Thanks for sorting this out. Great idea! ;)

Also, I have the "Improved PM Popup Start" hack installed. This should all be ok together, shouldn't it?

Erwin
05-17-2003, 03:39 AM
Not familiar with that hack, but if it's working, then it should be ok.

Smoothie
05-17-2003, 03:44 AM
so wait, let me get this straight. if you get an email with the pm content, the code in post 41 makes it so the pm is automatically made read. Whats the code in post 44 do? Does it stop the pm pop-up from happening?

Erwin
05-17-2003, 04:16 AM
Mmm... your post numbers are different to mine... the private.php code is like you say, to make the message read if email is sent.

The global.php is OPTIONAL and only if you get a global.php error - this hack may interfere with the PM popup direct PM link hack (at least here anyway) - if so, put that piece of code in to fix it.

Smoothie
05-17-2003, 04:26 AM
ah, ok, but here the question. If you get email with the pm content, and the code you posted makes the pm automatically read, is there a way to not get the pm popup if you have email on pm's? It seems very redundant to get the email and the pm popup. I'm not talking about changing the setting in your user cp, but if a user has pm email notification set to yes, the pm pop-up would be turned off.

Erwin
05-17-2003, 06:12 AM
With the changes as above, if the message is made read, the PM popup will not popup anyway, as there will be no new mesages. So there's no need to turn off pm popup. See?

Smoothie
05-17-2003, 06:31 AM
ya, I see, but I am still getting the pm pop-up after I get the email.

Smoothie
05-17-2003, 09:14 AM
hmmm, still not working right. I am still getting the messages as not being "read".

Erwin
05-17-2003, 09:58 AM
It works here. Try PMing yourself.

Boofo
05-17-2003, 03:37 PM
All of the pms now have [deny receipt] after them. Like this:

From the desk of Boofo [deny receipt]

even after logging onto the site and reading them.

This is happening on here, too. ;)

Smoothie
05-17-2003, 04:45 PM
right, thats what I'm saying, plus, if i go to message tracking, it says the messages are still unread by receipient, and still getting the stupid pop-up.

Boofo
05-17-2003, 05:10 PM
My message tracking (on vb.org here) shows only 3 messages as not read yet but in the private message listing I have about 10 messages with the [deny receipt] still after them (all made after this hack was installed here this morning).

Erwin
05-18-2003, 02:04 AM
To fix the deny receipt problem, we have to actually specify the receipt SQL part, so do this:

Find:


$DB_site->query("UPDATE privatemessage SET messageread=1, readtime='".time()."' $receiptSQL WHERE privatemessageid=$the_pm_id");


Change to:


$DB_site->query("UPDATE privatemessage SET messageread=1, readtime='".time()."', receipt=2 WHERE privatemessageid=$the_pm_id");


That should fix it. :)

Erwin
05-18-2003, 02:04 AM
I will fix my previous post to reflect this.

Smoothie
05-18-2003, 02:46 AM
hmm, ok, but i am still getting the pop-ups for new PM's...

Erwin
05-18-2003, 02:52 AM
Here, or at your own site?

Smoothie
05-18-2003, 05:58 AM
at Macfora.com

Smoothie
05-18-2003, 06:04 AM
I'm using this hack;
https://vborg.vbsupport.ru/showthread.php?s=&threadid=51963

plus this: $message in the emailsubject_pmreceived template

Erwin
05-18-2003, 06:14 AM
And you've made the changes in my post here as well?

Mmm... the popup shouldn't happen if the message is read, that's the thing... what about you, Boofo, do you have the same problem?

Smoothie
05-18-2003, 06:20 AM
yes, I applied this code change from here;
https://vborg.vbsupport.ru/showthread.php?postid=396011#post396011

and I am still getting PM pop-ups. For some reason, the PM is not being marked as read when the email is sent.

Erwin
05-18-2003, 07:01 AM
This line

$the_pm_id = $DB_site->insert_id();

is added ABOVE this line:

// enhanced
if ($prevmessageid) {

NOT BELOW - if you put it below, the code won't work. Did you do that correctly?

Erwin
05-18-2003, 07:02 AM
Like I said, the PMs are marked READ here and at Boofo's site, so the code works.

Boofo
05-18-2003, 08:00 AM
Erwin, the code works great at my site (as well as here) now. Thanks for the fix. ;)

Smoothie, did you also add the code from this post?

https://vborg.vbsupport.ru/showthread.php?postid=396017#post396017

Smoothie
05-18-2003, 05:12 PM
Today at 05:00 AM Boofo said this in Post #68 (https://vborg.vbsupport.ru/showthread.php?postid=396573#post396573)
Erwin, the code works great at my site (as well as here) now. Thanks for the fix. ;)

Smoothie, did you also add the code from this post?

https://vborg.vbsupport.ru/showthread.php?postid=396017#post396017
No, because in this post:
https://vborg.vbsupport.ru/showthread.php?postid=396031#post396031

Erwin says: The global.php is OPTIONAL and only if you get a global.php error - this hack may interfere with the PM popup direct PM link hack (at least here anyway) - if so, put that piece of code in to fix it. And I was not getting any errors.

Smoothie
05-18-2003, 05:13 PM
Today at 04:01 AM Erwin said this in Post #66 (https://vborg.vbsupport.ru/showthread.php?postid=396565#post396565)
This line

$the_pm_id = $DB_site->insert_id();

is added ABOVE this line:

// enhanced
if ($prevmessageid) {

NOT BELOW - if you put it below, the code won't work. Did you do that correctly?
Yes, it was correct, but I will re-check.

Smoothie
05-18-2003, 05:14 PM
Boofo-

You added both chunks of code? I only added the first code to private.php

Smoothie
05-18-2003, 05:37 PM
hmmm, ok, now the message appears to be marked read, but still getting the pop-ups for a new PM.

Boofo
05-18-2003, 05:48 PM
I wasn't getting any errors either but I added both codes just to be safe. Try it and see if that fixes the pop-up problem. The pop-up will only be gone when you are in the private.php. It will still work everywhere else. ;)

Smoothie
05-18-2003, 05:55 PM
But, if I add that code, what about users who don't have get email on new PM selected in the User CP? Will they still get pop-ups for new PM's?

Boofo
05-18-2003, 06:10 PM
That will only work if they have email notification set to on. Otherwise it works as normal. Besides, it only stops the pop-ups while you are in the private.php (your messages). You really don't need it there anyway, right? ;)

Smoothie
05-18-2003, 08:17 PM
I guess I might not be making my problem clear. The new PM popup happens on forumhome, even though I have selected yes to the email notification for new pms, and receive them via email.

Does the code that is added to global.php stop the new PM pop-ups on forumhome, if you select to receive pms via email?

Boofo
05-18-2003, 08:26 PM
No, it only stops it if you are in your private messages. The only way to stop it on the forumhome is to turn it off in your options. Is that what you are trying to do? Turn it off on forumhome, too?

Smoothie
05-18-2003, 08:31 PM
No, I guess I may have miss-understood what the extra code does. If we are making the PM's read once the email is sent, it makes no sense to also get a pop-up for the same PM on forumhome. I thought that was taken care of with the code changes....

Boofo
05-18-2003, 08:38 PM
Well, I just tried it and I don't get the pop-up on forumhome with the email turned on. With it turned off, I do. I also have a blinking "You've got mail" type message whenever there is a new message and it doesn't blink with email turned on, so it is working as it is supposed to. Did you use the new code (with receipt=2 in it) for the query? That code should cancel any pop-ups at all since it actually queries the db to say that message has been received. You must have something else going on somewhere.

Erwin
05-18-2003, 08:43 PM
I don't get it too. The popup should not happen if the PM is read.

Boofo
05-18-2003, 08:55 PM
The "messageread=1" should take care of that, right? It's got me baffled. Believe it or not, it works right on my site.

That's a first, huh, Erwin? Something working right on my site without having to tear it apart? LOL

Smoothie
05-19-2003, 01:49 AM
hey Boofo, you added the code for both private.php and global.php, right?

Boofo
05-19-2003, 03:37 AM
Yes, sir, I did. ;)

Smoothie
05-19-2003, 03:56 AM
K, now I'm totally lost on this. I have installed this hack:
https://vborg.vbsupport.ru/showthread.php?s=&threadid=51963

I added this code from erwins post:
https://vborg.vbsupport.ru/showthread.php?postid=396011#post396011

The code from this post I cannot find in global.php:
https://vborg.vbsupport.ru/showthread.php?postid=396017#post396017
I am getting the emails with the PM message, but some some odd reason it is marking the message read, but I still get the new PM popup.

Boofo
05-19-2003, 04:10 AM
First of all, uninstall the first hack and do the code in the following post instead. That might be your problem. ;)

https://vborg.vbsupport.ru/showthread.php?postid=385609#post385609

Boofo
05-19-2003, 04:15 AM
Look for this in the forum/global.php:

$newpmmsg=1;

instead of this:

if ($hack_pm_total > 1) {

The second code here is for the "Improved PM Popup Start" hack. The first code is from a unhacked global.php.

Smoothie
05-19-2003, 06:31 AM
no joy. :( removed the first hack, added the code from your link, hacked global.php... Still getting those damn popups on forumhome for new PM's.

Talisman
05-19-2003, 07:02 AM
Minor correction:

".....just put $message in the emailsubject_pmreceived template."

That's not right and it's been repeated in this thread.

You don't want to add text from the private message the subject line of the email notice they get; you have to add that to the message body, itself.

Instead --> add $message to the email_pmreceived template.

Erwin
05-19-2003, 09:57 AM
Oops... that's what I meant. :)