I have it set up with one image field value with this code:
$fileArray = my_json_decode($values["other_images"]);
$attachments = array();
foreach($fileArray as $f)
{
$attachments[] = array("path" => $f["name"]);
}
But now I have another image field value to add to it: $value["weight_image"]
Does any one know how to have it send the two image values in the same email?
Here is my full working code. But like I said I need to add another field called weight_image of a course 1 image file. The other_images is 4 images.:
$email="dispatch@ANOTHERDOMAIN.com";
$from="noreply@MYDOMAIN.com";
$subject="Trip Load: ".$values["trip_number"]."\r\n";
$fileArray = my_json_decode($values["other_images"]);
$attachments = array();
foreach($fileArray as $f)
{
$attachments[] = array("path" => $f["name"]);
}
$msg="Here is the load dimensions and information\r\n";
$msg.= "Width: ".$values["loaded_width"]." ".$values["loaded_width_in"]."\r\n";
$msg.= "Height: ".$values["loaded_height"]." ".$values["loaded_height_in"]."\r\n";
$msg.= "Front Overhang: ".$values["front_overhang"]." ".$values["front_overhang_in"]."\r\n";
$msg.= "Rear Overhang: ".$values["rear_overhang"]." ".$values["rear_overhang_in"]."\r\n";
$msg.= "Length: ".$values["loaded_length"]." ".$values["loaded_length_in"]."\r\n";
$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $msg, 'from'=> $from, 'attachments' => $attachments));
if(!$ret["mailed"])
echo $ret["message"];