Email Notification When File is Uploaded

Tessa

Member
Hello. After spending an hour reading through every possible forum post and fabrik wiki/documentation, I've seen many postings with the same question, but with no solution.

I understand in order to achieve these results, I need to:
  • Go to Form Plugin
  • -do "Email"
  • On Both new and edit
  • Add a condition
Code:
$origData = $formModel->getOrigData();
return $origData[0]->xxxx_tablename___fileuploadelement != {xxxx_tablename___fileuploadelement};

Something like this but this breaks the form after submission. What else is missing? I haven't worked with PHP or Fabrik in a long time, but helping my other half on this task :)

Thanks in advance! Also this should help with people searching for the same solution. :)
 
1. In general:
You should always quote placeholders in PHP code. Otherwise the code will break if the placeholder is empty.
So
return $origData[0]->xxxx_tablename___fileuploadelement != '{xxxx_tablename___fileuploadelement}';

2.
Debug the original data and the placeholder; I don't know by heart how these variables are looking in case of the fileupload element. Is it a simple upload or an ajax?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top