[[!FormIt? &hooks=`FormItAttach,email` &emailTpl=`emailTpl` &emailSubject=`***` &emailTo=`***@***.***` ]]
$attachment = '/tmp/***.***'; $scriptProperties['hook']->modx->mail->mailer->AddAttachment($attachment); return true;
[Wed Apr 30 10:56:35 2014] [error] [client ***] PHP Fatal error: Call to a member function AddAttachment() on a non-object in /***/core/cache/includes/elements/modsnippet/120.include.cache.php on line 31, referer: http://***/
$modx->getService('mail', 'mail.modPHPMailer');
$attachment = '/tmp/***.***'; $hook->modx->getService('mail', 'mail.modPHPMailer'); $hook->modx->mail->mailer->AddAttachment($attachment); return true;
$scriptProperties['hook']->modx->mail->mailer->AddAttachment($filepath);
[[!FormIt? &attachment=`pdf/file.pdf` &hooks=`Attachment,email,redirect` &emailTpl=`devisTpl` &emailSubject=`Subject` &emailTo=`[email protected]` &redirectTo=`6` &validate=`nospam:blank,email:required` ]]
<?php if(!empty($attachment)){ $basepath = $modx->getOption('/var/www/'); $scriptProperties['hook']->modx->mail->mailer->AddAttachment($basepath.$attachment); } return true;
[[!FormIt? &attachment=`pdf/[[+File]]` &hooks=`email,Attachment,redirect` &emailTpl=`emailTemplateBrochure` &emailTo=`[[+brochureEmail]]` &emailBCC=`[email protected]` &emailFrom=`[email protected]` &emailFromName=`Leenders Makelaardij` &emailSubject=`Brochure opgevraagd op de site van Leenders Makelaardij` &redirectTo=`28` &validate=`brochureNaam:required, brochureEmail:email:required` &submitVar=`brochureSubmit` ]]
<?php if(!empty($attachment)){ $basepath = $modx->getOption('base_path'); $scriptProperties['hook']->modx->mail->mailer->AddAttachment($basepath . $attachment); } return true;
[[!FormIt? &attachment=`path_to_file_on_server` &hooks=`spam,email,Attachment,FormItAutoResponder,redirect` &emailTpl=`myTpl` etc