This topic is locked

Send email with link to job

10/26/2008 8:47:06 AM
PHPRunner General questions
S
swanside author

Hello.
I have a project called timesheet, on this project, I have a checkbox called Complete and a unique reference number called Diary No.
WHen this box is ticked, I want it to send an email with a hyperlink of the Diary No on the server, so it would look something like
http://localhost/mobile/job_list.php?a=return+Diary No so the admin can just click on the link to get to the Job on the Job_list page?
Any ideas please?
Thanks
Paul

J
Jane 10/28/2008

Hi,
use After record added/updatedevents and Send simple email action on theEvents tab for this purpose.

All entered values are in the $values array, key values are in the $keys array.

To check field names use IF construction:

if ($values["FieldName"])

{

//send your email here

}

S
swanside author 10/28/2008

Thanks Jane, but dont go too far, you know I will be asking more next week on this.
Cheers
Paul

S
swanside author 11/8/2008

Hi Jane, I have used this code. It works good, but it sends too much info.
I have four fields
tick, info, value and id.
I just want it to send the id as a hyperlink to the id on the Job_List.php page
Any help please?

if ($values["tick"])

{

$email="me@aol.com";

$message="";

$subject="Updated data record";
foreach($values as $field=>$value)

$message.= $field." : ".$value."\r\n";



mail($email, $subject, $message);

}


Thanks
Paul

J
Jane 11/10/2008

Hi,
you can form email body manually in your event.

All entered values are in the $values array, I.e. $values["FieldName1"], $values["FieldName2"], etc.

S
swanside author 11/10/2008

What holds the field names please?
Would this be $field["FieldName1"], $field["FieldName2"],
Thanks

Paul

Sergey Kornilov admin 11/10/2008

Paul,
in PHP arrays hold both keys (field names in this case) and values:

foreach($values as $key => $value)

{

echo $key.": ".$value."<br>";

}