Buy Now
Sign in

Email only when Attachments

tshirley , October 27 2015, 23:01
tshirley 318
October 27 2015, 23:01 #352903

I would like to send an email from a form only if the user attaches a file to the form.

Is there any way I can detect in an Event Switcher, if an attachment has been uploaded?


GreyHead 65
October 28 2015, 10:05 #352921
Hi Tim,

Check the entries in $form->files - probably just the count is enough
if ( count($form->files > 0 ) {
echo 'file_uploaded';

ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much