Help - Search - Members - Calendar
Full Version: "BB code" in email notification subject
Invision Power Services > Invision Power Services, Inc. > IPS Company Feedback > IP.Board
Buster XXL
Hi,

Members of our forum asks us if it's possible to get the topic name in the Subject filed in the notification mail that is sent out.
I tried to add "<#TITLE#>" in the text string that the ibf.lang.tt_subject variable is set to, but no topic name was "inserted" in the subject. The "<#TITLE#>" had just been replaced with "" in the notification mail .
IMO I think the feature our member is asking for is quite good, specially for very active members that subscribe on many threads and that receives quite many notification mails. With this feature they get a chance to "prioritize" the notifications just by looking at the subject with out having to open the mail to see which topic/thread it concerns.

Is this a "relevant" feature which is possible to implement ?

FYI: We're currently using IPB 2.1.2.

Regards
Geraint
Since the very first version, I implement this feature myself in the PHP sources after every update, because I love to have it. So it's definitely possible and isn't a big trick at all.
If you want to have me posting the changes, I'll do so, right if I'm home this evening.

Regards
Geraint
Buster XXL
QUOTE(Geraint @ Oct 28 2005, 03:08 PM) *
Since the very first version, I implement this feature myself in the PHP sources after every update, because I love to have it. So it's definitely possible and isn't a big trick at all.
If you want to have me posting the changes, I'll do so, right if I'm home this evening.

Regards
Geraint


Thanx !! If You post the code change/addition I'll be more than happy !!
Note: Have no experience what so ever of programming in PHP (stuck in the C programming "swamp" the last 15 years ;o)
Geraint
Sorry, I nearly forgot you, but here's the trick for IPB 2.1.2

Open sources/classes/post/class_post.php in your favourite text editor

Find the following code (around line 413)
CODE
//-----------------------------------------
// Add to mail queue
//-----------------------------------------

$this->ipsclass->DB->do_insert( 'mail_queue', array( 'mail_to' => $r['email'], 'mail_date' => time(), 'mail_subject' => $this->ipsclass->lang['tt_subject'], 'mail_content' => $this->email->message ) );


Change it to
CODE
//-----------------------------------------
// Add to mail queue
//-----------------------------------------

$l_sTopic = $this->ipsclass->lang['tt_subject'].' '.$r['title'];
$this->ipsclass->DB->do_insert( 'mail_queue', array( 'mail_to' => $r['email'], 'mail_date' => time(), 'mail_subject' => $l_sTopic, 'mail_content' => $this->email->message ) );


and upload the file to the same destination in ASCII mode.

Make sure, you have a celan backup copy, whether something wents wrong (fingers crossed). And change your language file for the Email subject to something like "New reply to topic", that will expand to "New reply to topic name of the topic here".

HTH
Geraint
Buster XXL
QUOTE(Geraint @ Oct 28 2005, 11:50 PM) *
Sorry, I nearly forgot you, but here's the trick for IPB 2.1.2

Open sources/classes/post/class_post.php in your favourite text editor

Find the following code (around line 413)
CODE
//-----------------------------------------
// Add to mail queue
//-----------------------------------------

$this->ipsclass->DB->do_insert( 'mail_queue', array( 'mail_to' => $r['email'], 'mail_date' => time(), 'mail_subject' => $this->ipsclass->lang['tt_subject'], 'mail_content' => $this->email->message ) );


Change it to
CODE
//-----------------------------------------
// Add to mail queue
//-----------------------------------------

$l_sTopic = $this->ipsclass->lang['tt_subject'].' '.$r['title'];
$this->ipsclass->DB->do_insert( 'mail_queue', array( 'mail_to' => $r['email'], 'mail_date' => time(), 'mail_subject' => $l_sTopic, 'mail_content' => $this->email->message ) );


and upload the file to the same destination in ASCII mode.

Make sure, you have a celan backup copy, whether something wents wrong (fingers crossed). And change your language file for the Email subject to something like "New reply to topic", that will expand to "New reply to topic name of the topic here".

HTH
Geraint


Thanx !!! Will try it out !!
mrben
You can also use your own custom text and the variables listed. ie

$new_subject = "New Post by ". $mname;
or
$new_subject = "New Post entitled ". $title ." by ".$mname;

$this->ipsclass->DB->do_insert( 'mail_queue', array( 'mail_to' => $r['email'], 'mail_date' => time(), 'mail_subject' => $new_subject, 'mail_content' => $this->email->message ) );

RainbowViper
Does that work, unaltered, for the Current Version 2.3.4?

Thanks in advance!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.