I’m using eForm’s feature to send an automessage to the site visitor who fills out the form. In the template (chunk) I specify to eForms automessage parameter, I tried using PHX. It didn’t work (the PHx code shows up in the email). PHx is installed and I use it elsewhere on the site. I looked through the eForm code and tried a modification:
# send auto-respond email
//defaults to html so only test sendasText
$isHtml = ($sendAsText==1 || strstr($sendAsText,’autotext’))?false:true;
if ($autotext && $fields[’email’]!=’’) {
// CUSTOM
//$autotext = formMerge($autotext,$fields);
$fields1 = $fields;
$autotext = $modx->parseChunk($autotexttemplate,$fields1,’[+’, ’+]’);
// end CUSTOM
$mail = new PHPMailer();
$mail->IsMail();
$mail->CharSet = $modx->config[’modx_charset’];
$mail->IsHTML($isHtml);
$mail->From = ($autosender)? $autosender:$from;
$mail->FromName = ($autoSenderName)?$autoSenderName:$fromname;
$mail->Subject = $subject;
$mail->Body = $autotext;
AddAddressToMailer($mail,"to",$fields[’email’]);
if(!$mail->send()) return ’AutoText: ’ . $_lang[’ef_mail_error’] . $mail->ErrorInfo;
}
Sorry ... I somehow submitted this post before I was done formatting, etc.
I tried using parseChunk. Still ... PHx doesn’t seem to work.
Has anyone ever used PHx with eForm as it pertains to the automessage template?