I have a formit form and i have to send email 2 different emails using 2 different email tpls with the form values.
The issue is that the formit allows you to set one or more emailtpls but all the recipients will receive the same email.
I’ve tried to use a snippet to return the chunk but the form values are not filled it is just showing the placeholders (see pic below)
My current snippet code is calling the chunk used to the emailtpl in formit
$to = "email@example.com";
$subject = “CyprusArt - New Testimony”;
$message = $modx->getChunk('AnonymousTestimonyFormEmailChunk'); // Always set content-type when sending HTML email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; // More headers // $headers .= 'Cc: firstname.lastname@example.org' . "\r\n"; mail($to,$subject,$message,$headers);