Buy Now
Sign in

Email only when Attachments

tshirley , October 27 2015
T
tshirley
Hello,

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?

Cheers

Tim
GreyHead
Hi Tim,

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

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