View Full Version : Send Part of User's Reply with Email Notification
Logician
02-08-2002, 10:00 PM
Hiyas,
I dont like static email notifications and fancy coloring them up a bit. So this hack is one way to do it. (If I can spare time, more is likely to follow) ;)
This hack simply sends a small portion of user's reply to thread subscribers in their notification mail. It's also possible to send the whole reply, but I dont suggest this, because if they read it all, they wont visit the original thread. But just giving a hint and sending a few lines can be provoking to get them to your board ASAP.
It's an easy to install hack and you can easily customize it by choosing how many characters of the reply will be sent to the members.
I use this hack in V.2.2.2 and havent noticed any problems. Please report bugs in this thread..
Enjoy! \\=^))
Regards,
Logician
Sounds interesting... Anything for get the members back :D
Nice hack thanks, I'll try it. Does it strip vB code? If not, can you please add that feature.
Thanks
Logician
02-13-2002, 08:51 AM
Hey there,
Originally posted by dost
Does it strip vB code? If not, can you please add that feature.
Striping the VB code feature is not very easy to add. ;) I am adding other hacks to my board at the moment (and sharing them here) and if can find time for your request, I'll let you know.. :cool:
Regards,
Logician
Logician,
Great hack! Very helpful to keep the users visiting the forums.
A question though: one of my mods is restricted to surf the web at his work, but is able to receive e-mail.
I want to enable full message posting for him, but limited to 50 chars for all other visitors.
I've tried the following code in newreply.php, but to no avail:
if ($visible) {
if ($bbuserinfo[userid]==xxx) {
// LOGICIAN SEND PART OF USER REPLY WITH EMAIL NOTIFICATION HACK
$logic_mes_sum= $message;
} else {
$logic_mes_sum= substr($message, 0, 50)."... ";
}
// LOGICIAN SEND PART OF USER REPLY WITH EMAIL NOTIFICATION HACK
sendnotification ($threadinfo['threadid'], $bbuserinfo['userid'], 0);
}
How can I enable full extracts for this specific user, but limited extracts for all others?
Logician
07-06-2002, 07:26 AM
Originally posted by djr
How can I enable full extracts for this specific user, but limited extracts for all others?
What you did it is uncorrect. (Revert your modification to original)You have to edit admin/functions:
Find:
$touser['username']=unhtmlspecialchars($touser['username']);
After that replace the part:
eval("\$emailmsg = \"".gettemplate("email_notify",1,0)."\";");
eval("\$emailsubject = \"".gettemplate("emailsubject_notify",1,0)."\";");
mail($touser[email],$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$webmasteremail>");
As:
if ($touser['userid']==X){
eval("\$emailmsg = \"".gettemplate("email_notify_special",1,0)."\";");
eval("\$emailsubject = \"".gettemplate("emailsubject_notify",1,0)."\";");
mail($touser[email],$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$webmasteremail>");
}
else
{
eval("\$emailmsg = \"".gettemplate("email_notify",1,0)."\";");
eval("\$emailsubject = \"".gettemplate("emailsubject_notify",1,0)."\";");
mail($touser[email],$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$webmasteremail>");
}
(Replace X with userid of your special user.)
Now add a new template named email_notify_special, the content is same with email_notify template, just one modification:
Replace $logic_mes_sum as $message in the new template.
I didnt test this but it should work..
Enjoy.. :)
Logician
Logician,
Thank you, that worked flawlessly! :cool:
I had ofcourse reverted all my changes to your hack, because it gave me some errors. With this update the whole contents of the reply is sent by e-mail (tested on myself).
Again, great hack and great update! Thank you for quick reponse.
- djr
Massiel
07-07-2002, 11:47 AM
Does this work with 2.2.6??
yep, got 2.2.6 installed myself
MalaK_3araby
09-12-2002, 10:21 PM
Logician ... Thanks man.
Talisman
10-16-2002, 07:32 AM
Great hack, Logician. Thanks!
Our new group comes from another that's been around for years where some of us read online, but many subscribe to what's posted by way of a mailing list.
This will make a lot of people very happy.
Cheers!
leon2u
11-21-2002, 10:46 AM
Hai there,
I want to use your hack but I need it for this:
My sub-forum is called UPDATES so whenever I make a new thread (and a new posting is made automatically of course) I want to have the message contents in my e-mailmoderator template. Your hack does not work all the way because in creating the thread it does not see the message contents. It works but only when you add a second posting in that thread.
Can you help me?
Doubledoom
03-17-2003, 06:30 PM
Installed it on 2.3.0 - waiting for first email reply to check its working. ;)
However, install instructions were straightforward enough and there were no code differences to be concerned with.
Boofo
03-19-2003, 07:28 AM
Sinan, did you ever find the time to come up with the code to strip out vbcode in the message? vb 3.0 has that feature and it would be good to have it for those of us who aren't going to upgrade right away. ;)
ryancooper
04-14-2003, 12:05 AM
Great hack . . .The only problem I have is now there is no subject in the emails. . .
Logician
04-14-2003, 05:58 AM
Today at 03:59 AM ryancooper said this in Post #15 (https://vborg.vbsupport.ru/showthread.php?postid=381736#post381736)
Great hack . . .The only problem I have is now there is no subject in the emails. . .
The hack does not touch anything related to the subject of the mail, so this can't be. :) Besides the emails (and its subject) sent are default vb notification mails, the hack does not change this behaviour either. It just adds some text inside mail, that's it.
I'd say uninstall it, make sure your default vb notifications has subjects, then reapply (carefully!) ;)
Ps. You look "unlicensed" here, please check your email address you use here in vbulletin.com and make sure it is authorized in members section of vbulletin.com. Thanks..
ryancooper
04-14-2003, 10:16 AM
Will do and I added my email to VB.com
THanks. . . :bunny:
ryancooper
04-14-2003, 01:19 PM
Found it it wasn;t anything you did I was a error in VB
http://www.vbulletin.com/forum/showthread.php?threadid=68750
Thanks!
Logician
04-14-2003, 02:24 PM
ok glad you find the culprit and thx for sharing here too..
02-13-02 at 11:45 AM Logician said this in Post #4 (https://vborg.vbsupport.ru/showthread.php?postid=220121#post220121)
Striping the VB code feature is not very easy to add...
Logician, you could try something like this:
$string = preg_replace( '~<[^\]]*>~' , '' , $string );
$string = str_replace( '"' , '' , $string );
That should take care of all your BB Code...
Let me know what you think. :)
Logician
04-14-2003, 04:57 PM
Today at 06:57 PM TECK said this in Post #20 (https://vborg.vbsupport.ru/showthread.php?postid=382041#post382041)
Logician, you could try something like this:
$string = preg_replace( '~<[^\]]*>~' , '' , $string );
$string = str_replace( '"' , '' , $string );
That should take care of all your BB Code...
Let me know what you think. :)
Does it? I dont think so.. Have you tested it? :)
trafix
04-15-2003, 01:12 AM
Today at 01:13 AM ryancooper said this in Post #18 (https://vborg.vbsupport.ru/showthread.php?postid=382006#post382006)
Found it it wasn;t anything you did I was a error in VB
http://www.vbulletin.com/forum/showthread.php?threadid=68750
Thanks!
PHEW!! Had me worried there for a minuite..... I had the same problem, fixed now.
Thanks for posting the solution
Yesterday at 06:51 PM Logician said this in Post #21 (https://vborg.vbsupport.ru/showthread.php?postid=382114#post382114)
Does it? I dont think so.. Have you tested it? :)
I did not test it... but if my logic is good, that code will remove all bbcode from the content.
Basically removes everything in between [ brackets.
You can start working from there... to adjust it onto your hack.
Example, the code:
$string = preg_replace( '~<[^\]]*>~' , '' , $string );
can be also written as:
$string = preg_replace( '~\[[^\]]*\]~' , '' , $string );
and on and on...
sorry... i didn`t understand any worl u said... just wonderin` how to make it work on 2.3.0 couse in admin/functions.php avarything changed now with email function... i`m bad in PHP so help me please just run that great hack on!
Thanx!
mccollin
08-25-2003, 08:45 PM
This is very strange, not probably related to this HACK, but I can't get it installed because of it. First off, I only have 3 hacks installed on my site, and non that have anything to do with notifications.
I am losing the Subject in the email when I install this hack. I agree that it makes no sense for this to happen, because we don't touch that code, and the templates are separate. What I've narrowed it down to, is the email_notify template. If I change that template from the default, it loses the subject. I tried totally removing the hack, and just changing the email_notify template to add some text, and the subject was gone. I reverted to original, and it came back. This makes no sense. Anyone else run into this. I'm on 2.3.0
assassingod
08-25-2003, 08:54 PM
Today at 10:45 PM mccollin said this in Post #25 (https://vborg.vbsupport.ru/showthread.php?postid=428618#post428618)
This is very strange, not probably related to this HACK, but I can't get it installed because of it. First off, I only have 3 hacks installed on my site, and non that have anything to do with notifications.
I am losing the Subject in the email when I install this hack. I agree that it makes no sense for this to happen, because we don't touch that code, and the templates are separate. What I've narrowed it down to, is the email_notify template. If I change that template from the default, it loses the subject. I tried totally removing the hack, and just changing the email_notify template to add some text, and the subject was gone. I reverted to original, and it came back. This makes no sense. Anyone else run into this. I'm on 2.3.0
Best to read the thread before posting;)
http://www.vbulletin.com/forum/showthread.php?threadid=68750
mccollin
08-26-2003, 12:38 PM
Thanks for the help. I read this whole thread twice, but never saw this info.
lalo landa
09-19-2003, 07:55 AM
if U have an a html mail notify
to interprate the vbcodes remplace
if ($visible) {
// LOGICIAN SEND PART OF USER REPLY WITH EMAIL NOTIFICATION HACK
$logic_mes_sum= substr($message, 0, 50)."...";
// LOGICIAN SEND PART OF USER REPLY WITH EMAIL NOTIFICATION HACK
sendnotification ($threadinfo['threadid'], $bbuserinfo['userid'], 0);
}
For this
// LOGICIAN SEND PART OF USER REPLY WITH EMAIL NOTIFICATION HACK
$logic_mes_sum= $message=bbcodeparse2($message,0,1,1,1);
// LOGICIAN SEND PART OF USER REPLY WITH EMAIL NOTIFICATION HACK
sendnotification ($threadinfo['threadid'], $bbuserinfo['userid'], 0);
}
All the message will be showed
To send a html notify mail
This hack: https://vborg.vbsupport.ru/showthread.php?p=435104#post435104
midnightz
10-20-2003, 11:12 PM
Is there a way or a hack to do this for PM's so the PM will be sent with the email alert?
Aaron1
03-23-2004, 08:03 PM
Hi,
I moved my forum to a new server but suddenly i have a strange but annoying problem. Whenver someone subscribes to thread, the e-mail he gets sent looks terrible because it lacks linebreaks, i double checked if this hack isn't properly installed, but that's not the case. Anyone have a clue what could be the problem?
Btw all e-mails sent out misses linebreaks (br's) very weird.
Logician
03-24-2004, 07:15 AM
Hi,
I moved my forum to a new server but suddenly i have a strange but annoying problem. Whenver someone subscribes to thread, the e-mail he gets sent looks terrible because it lacks linebreaks, i double checked if this hack isn't properly installed, but that's not the case. Anyone have a clue what could be the problem?
Btw all e-mails sent out misses linebreaks (br's) very weird.
Is it all emails that misses line breaks or only email that this hack sends?
Aaron1
03-24-2004, 07:57 AM
That's the weird thing, all e-mails that are send out Logician, do you have an idea what could be the cause of that?
Aaron1
03-24-2004, 01:18 PM
Shall I e-mail you the admin/functions.php if you want to take a look at it?
Here's an example how a notify e-mail looks like in my mailbox:
Hello Housequake, sowtob has just replied to a thread you have subscribed to entitled - Cosmic day???? - in the Trading/Discussion forum of Forum Home. Here is a small part of the reply: ---------------------------------------------------- He's back today or tomorrow I think.... ---------------------------------------------------- This thread is located at: http://www.housequake.com/forum/showthread.php?threadid=15893&goto=newpost There may be other replies also, but you will not receive any more notifications until you visit the board again. Yours, Housequake.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Unsubscription information: To unsubscribe from this thread, please visit this page: http://www.housequake.com/forum/member2.php?action=usub&threadid=15893 To unsubscribe from ALL threads, please visit this page: http://www.housequake.com/forum/member2.php?action=usub&type=allthread
Logician
03-24-2004, 05:52 PM
If all emails are like this, how can this be related to this hack? ^^ Have you checked email templates and confirmed that they are good in terms of line breaks?
Aaron1
03-24-2004, 05:59 PM
I even triple checked my templates Logician, could it be something server side?
All templates seem to be stored without linebreaks automatically somehow.
Logician
03-24-2004, 06:09 PM
I even triple checked my templates Logician, could it be something server side?
All templates seem to be stored without linebreaks automatically somehow.
Have you moved to a Window server? It sounds like it. Check here:
http://www.vbulletin.com/forum/showthread.php?t=25810
Aaron1
03-24-2004, 06:18 PM
Yes! I did Logician, thanks for this link (otherwise i would have never found it) :-)
subu1
06-03-2004, 07:21 PM
Hi,
Great Hack, big thxx, ist works....*click install*
Shall I e-mail you the admin/functions.php if you want to take a look at it?
Here's an example how a notify e-mail looks like in my mailbox:
Hello Housequake, sowtob has just replied to a thread you have subscribed to entitled - Cosmic day???? - in the Trading/Discussion forum of Forum Home. Here is a small part of the reply: ---------------------------------------------------- He's back today or tomorrow I think.... ---------------------------------------------------- This thread is located at: http://www.housequake.com/forum/showthread.php?threadid=15893&goto=newpost There may be other replies also, but you will not receive any more notifications until you visit the board again. Yours, Housequake.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Unsubscription information: To unsubscribe from this thread, please visit this page: http://www.housequake.com/forum/member2.php?action=usub&threadid=15893 To unsubscribe from ALL threads, please visit this page: http://www.housequake.com/forum/member2.php?action=usub&type=allthread
Hi Logician,
I have installed this hack onto my test board which is on my laptop using XP, and have seen that this problem occurs on windows servers, however my live site is on a Linux server, so will everything just translate across without any problems? ie will the line breaks be enforced, unlike when they are on Windows servers?
Logician
10-03-2004, 10:46 AM
I'm using the hack both in linux and windows servers just fine.
Hi Logician,
I am only looking for clarification my question, on my test board (on my XP laptop) my template preview screen (in forums/admin) displays similar to Aaron1's post. (remember I have not tested it on the live site yet)
A link you gave to Aaron indicated that Windows servers handle it differently, and thus i suspect that as i am running my test board on XP, this is why there are no breaks (in the preview; i havent tried it live yet)
But i guess the real question to this is "even though my template preview (on XP) does not show line breaks, when i upload this to the live site (linux), i presume it will work flawlessly without any issues since the "no line break issue" is Windows related! Yes?
Just trying to get my head around this!
Logician
10-03-2004, 06:44 PM
Your assumption is correct.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.