View Full Version : New Message Alert: #%ticket %email
simplysped
02-21-2008, 02:21 PM
Hi, for some reason %email works in the message, but it doesn't work in the subject. Is there a way to get this to work?
simplysped
02-21-2008, 02:27 PM
It seems to work with the subject in the default ones. But when I try to put it in the staff messages not even [#%ticket] works
Zoidberg
02-22-2008, 07:34 PM
You've got to edit class.ticket.php to include
$body = str_replace("%email",$var['email'],$body);
at the appropriate places
simplysped
02-25-2008, 08:46 AM
You've got to edit class.ticket.php to include
$body = str_replace("%email",$var['email'],$body);
at the appropriate places
Not really understanding, here is what im getting for email subjects
"New Ticket Alert: [#%ticket]"
"New Ticket Alert - %name"
everything works in the body though
Zoidberg
02-25-2008, 10:18 PM
$subj = str_replace("%email",$var['email'],$subj);
str_replace (http://en.php.net/str_replace) replaces your %email dummy with the contents of $var['email'], %ticket respectively.
Do a search for $subj = str_replace in your class.ticket.php and you'll see what i mean.
simplysped
02-26-2008, 10:34 AM
$subject = str_replace("%email",$var['email'],$subject);
str_replace (http://en.php.net/str_replace) replaces your %email dummy with the contents of $var['email'], %ticket respectively.
Do a search for $subject = str_replace in your class.ticket.php and you'll see what i mean.
ok... i stuck that line here
$resp=db_query($sql);
if(db_num_rows($resp) && list($subj,$body)=db_fetch_row($resp)){
$body = str_replace("%name", $var['name'],$body);
$body = str_replace("%email",$var['email'],$body);
$body = str_replace("%url", $cfg->getBaseUrl(),$body);
$subject = str_replace("%email",$var['email'],$subject);
Misc::sendmail($var['email'],$subj,$body,$cfg->getNoReplyEmail());
}
}
is that correct?
Zoidberg
02-27-2008, 12:55 AM
include/class.ticket.php, approx. line 517 - 526
//If enabled...send alert to staff (New Message Alert)
if($cfg->alertONNewMessage()){
$sql='SELECT message_alert_subj,message_alert_body FROM '.EMAIL_TEMPLATE_TABLE.' WHERE cfg_id='.db_input($cfg->getId()).' AND tpl_id='.db_input($cfg->getDefaultTemplateId());
$resp=db_query($sql);
if($resp && list($subj,$body)=db_fetch_row($resp)){
$subj = str_replace("%ticket", $this->getExtId(),$subj);
$subj = str_replace("%subject", $this->getSubject(),$subj);
$subj = str_replace("%email", $this->getEmail(),$subj);
include/class.ticket.php, approx. line 994 - 1003
//If enabled...send alert to staff (New Ticket Alert)
if($alertstaff && $cfg->alertONNewTicket() && is_object($ticket)){
$sql='SELECT ticket_alert_subj,ticket_alert_body FROM '.EMAIL_TEMPLATE_TABLE.
' WHERE cfg_id='.db_input($cfg->getId()).' AND tpl_id='.db_input($cfg->getDefaultTemplateId());
$resp=db_query($sql);
if($resp && list($subj,$body)=db_fetch_row($resp)){
$subj = str_replace("%ticket", $ticket->getExtId(),$subj);
$subj = str_replace("%subject",$ticket->getSubject(),$subj);
$subj = str_replace("%email",$ticket->getEmail(),$subj);
The above code adds the %email field to New Message Alert and New Ticket Alert Email Subjects. The above fix may not be particularly useful to You in the long run. Why not have Your from field contain fancy information (http://www.osticket.com/forums/showthread.php?t=396)?
simplysped
02-28-2008, 09:21 AM
dear god am I lost.
I'm going to talk to my boss about hiring someone to correctly configure this system, if anyone is interested in making a little cash pm me
dear god am I lost.
I'm going to talk to my boss about hiring someone to correctly configure this system, if anyone is interested in making a little cash pm me
Check http://www.osticket.com/support/
simplysped
02-28-2008, 03:08 PM
Check http://www.osticket.com/support/
We originally went there to try and get Commercial Support but after two weeks we never got a response.
Strange, perhaps you can send a PM to Peter directly.