Jump to content

"BB code" in email notification subject


Guest Buster XXL

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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)
Link to comment
Share on other sites

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)

//-----------------------------------------

// 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

//-----------------------------------------

// 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

Link to comment
Share on other sites

Sorry, I nearly forgot you, but here's the trick for IPB 2.1.2



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



[b]Find[/b] the following code (around line 413)


//-----------------------------------------

// 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

//-----------------------------------------

// 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 !!
Link to comment
Share on other sites

  • 2 years later...

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 ) );

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...