UDT, attach formbuilder file upload to email
Posted: Tue May 26, 2015 6:44 pm
Hey,
I have another thread that this option can solve.... if I can attach a file uploaded through Formbuilder with a UDT and send it via CMSMailer. Note, files are being uploaded.
Note: 'Deny file to be attached with emails', is unticked.
Can anyone see a problem in my UDT with the file upload/attachment:
$actparams = $smarty->get_template_vars('actionparams');
$form_id = $actparams['form_id'];
if($form_id == 5) {
$mail = cms_utils::get_module('CMSMailer');
{* -- my file upload is {$attachcv} / {$fld_53} -- *}
if(!empty($params['fld_53'])) {
$fileupload = $params['fld_53'];
} else {
$fileupload = '';
}
$subject = " here ";
$body = " body of email ";
$mail->AddAddress( $destination );
$mail->IsHTML( true );
$mail->SetBody( $body );
$mail->SetSubject( $subject );
$mail->AddAttachment('$fileupload', 'PDF file', 'base64', 'application/pdf');
$mail->Send();
$mail->reset();
}
Also see http://forum.cmsmadesimple.org/viewtopi ... =8&t=67308
I have another thread that this option can solve.... if I can attach a file uploaded through Formbuilder with a UDT and send it via CMSMailer. Note, files are being uploaded.
Note: 'Deny file to be attached with emails', is unticked.
Can anyone see a problem in my UDT with the file upload/attachment:
$actparams = $smarty->get_template_vars('actionparams');
$form_id = $actparams['form_id'];
if($form_id == 5) {
$mail = cms_utils::get_module('CMSMailer');
{* -- my file upload is {$attachcv} / {$fld_53} -- *}
if(!empty($params['fld_53'])) {
$fileupload = $params['fld_53'];
} else {
$fileupload = '';
}
$subject = " here ";
$body = " body of email ";
$mail->AddAddress( $destination );
$mail->IsHTML( true );
$mail->SetBody( $body );
$mail->SetSubject( $subject );
$mail->AddAttachment('$fileupload', 'PDF file', 'base64', 'application/pdf');
$mail->Send();
$mail->reset();
}
Also see http://forum.cmsmadesimple.org/viewtopi ... =8&t=67308