Hello Seb,
a way to do that is to use the plugin Field Code "Afterstore".
In your form, in the hidden position, you put 3 fields (keep the order below):
- Plugin Field AfterStore
- Plugin Field Email 1
- Plugin Field Email 2
in the Plugin Field Afterstore you just have to put your two conditions:
If ( !$fields['condition1']->value ){
unset( $fields['email1'] );
}
If ( !$fields['condition1']->value ){
unset( $fields['email2'] );
}
$fields is the table with all fields of your form.
In the Plugin Field Email, all emails are send in the event "AfterStore", so if you unset undesirable fields before this event, they won't be executed.
Best regards.
Lionel