This topic is locked
[SOLVED]

 send templated email link does not work

11/18/2012 1:53:16 PM
PHPRunner General questions
C
chrispa author

hi before add i have folllowing script to send templated email

which is working fina and i get the email as i want etc.

the only problem is that the ##link## replace does not contain the record id for some reason can someone help?

see below code up to the part i want to display anyone can help to get the link correclty?
http://ttttt.com/tracking_manual_list.php?recordid=".$id."&action=update --- on the email can not get the $id so the link is useless
$email_message = file_get_contents("order.txt");

// replace variables

$email_message = str_replace("##prefix##",$values["prefix"],$email_message);

$email_message = str_replace("##awb##",$values["awb"],$email_message);

$email_message = str_replace("##carrier##",$values["carrier"],$email_message);

$email_message = str_replace("##from##",$values["from"],$email_message);

$email_message = str_replace("##to##",$values["to"],$email_message);

$email_message = str_replace("##details##",$values["details"],$email_message);
$email_message = str_replace("##link##","http://ttttt.com/tracking_manual_list.php?recordid=".$id."&action=update"

,$email_message);
// send HTML email

runner_mail(array('to' => $values["email1"],'bcc' => $values["email2"],'cc' => $values["email3"], 'from' =>"info@xxxx.gr", 'subject' => "Track & Trace on line System from AWB No.".$values['prefix'] . "-" . $values['awb'], 'htmlbody' => $email_message, 'charset' => 'UTF-8'));

Sergey Kornilov admin 11/18/2012

Use AfterAdd event. In BeforeAdd event record haven't created created yet meaning there is no ID.

C
chrispa author 11/19/2012



Use AfterAdd event. In BeforeAdd event record haven't created created yet meaning there is no ID.


thanks a lot