I am still experiencing mail being sent when not desired, passing 1 or 0...I believe this code is overriding it:
Code:
//<?php
noemail => isset($noemail)? true:false,
This could certainly use a bit of improvement. As it is, regardless what value you set the &noemail parameter to, the result is that $noemail is set to a boolean TRUE and according to the code
if($noemail) { no email should be sent out... I’m surprised this parameter doesn’t seem to work for you. I use it all the time when testing my forms.
OR Maybe this would be better:
Code:
//<?php
noemail => isset($noemail)? $noemail:0,
Definitively the better way to go but to get a true boolean value I’d change it to:
//<?php
noemail => isset($noemail)? $!(!$noemail):false,
By negating $noemail (twice) it is forced to a true boolean value.
Update: Hmm...I tried both, and was receiving similar results....It turns out, I had to modify the core in order to get emails to drop:
if( $nomail != false ) evaluates to TRUE if $noemail is TRUE
if( !$nomail ) evaluates to TRUE if $noemail is FALSE
You’ve basically reversed the test...
which means you might get some unexpected behaviour in other forms.
However I’ve just reviewed the eForm code and there’s some anomaly with $noemail. Around line 395 there’s a test for $nomail (missing e) which is set depending on if there’s a valid To: address. These two vars should really be one and the same and it could make all the difference in your case. I’ve made a note to review this for the next point release.