Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP
Author Message
Donovan
Client



Joined: Oct 07, 2003
Posts: 735
Location: Ohio

PostPosted: Fri Sep 21, 2007 10:15 am Reply with quote

Anybody ever did something like this? I see that Nuke uses the phpbb template for emailing stuff like registration and private messages.

What I have in my submitComment function is the following:

$cid = $db->sql_nextid(); // capture last cid autoincrement value.
notify($cid);

The notify funtion will send the email that they have a waiting comment to reply to.

Code:
function notify($cid) {

global $db;   
$sql = $db->sql_query("SELECT * FROM comment_queue cq JOIN director d
ON d.course_id = cq.course_id
WHERE cid = '$cid'");
if (!$sql) {
      echo("<p>Error performing query: " . mysql_error() . "</p>");
      exit();   
      }      
while ($row = $db->sql_fetchrow($sql)) {
$to = $row['email'];
$subject = $row['title'];
$message = $row['comment_text'];
}

$headers = 'From: Questions' . "\r\n" .
    'Reply-To: questions@wright.edu' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);         
}


What I would like to do is use a template to format the email and make it more professional looking.

After looking at the privmsg_notify.tpl, I am trying to do something like:


Code:
Subject: New Question has arrived

Charset: iso-8859-1

Hello Professor {USERNAME},

You have received a new question on the School of Medicine Question System. You can view your new question by clicking on the following link:

{Q_LINK}


I have searched the Forum module for code that I could duplicate to use this, but have come up empty.

Some sort of

Code:
$template->set_filenames('body.tpl');
 
View user's profile Send private message Visit poster's website ICQ Number
Donovan







PostPosted: Fri Sep 21, 2007 2:24 pm Reply with quote

Took me all day but I think I got it.

I would post the code but again NukeSentinal blocks me and I don't have the time to create a txt and upload.
 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Sat Sep 22, 2007 7:23 am Reply with quote

As long as you have got it, no worries m8.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©