Yes, you should be able access the form fields and field values with event.detail.inputs
in addEventListener
on wpcf7mailsent
. You can then use the field values in the conditional statements and add the redirects you need. There’s a simple code sample in the plugin doumentation, https://contactform7.com/dom-events/, for looping the fields.
EDIT
Here’s a code example,
document.addEventListener( 'wpcf7mailsent', function( event ) {
var inputs = event.detail.inputs,
inputCount = inputs.length,
firstCondition,
secondCondition;
for ( var i = 0; i < inputCount; i++ ) {
if ( 'first-condition-field' == inputs[i].name ) {
firstCondition = inputs[i].value
} else if ( 'second-condition-field' == inputs[i].name ) {
secondCondition = inputs[i].value
}
}
if ( 'foo' == firstCondition && 'bar' == secondCondition ) {
location = 'https://www.example.com/thank-you-1/';
} else if ( 'bar' == firstCondition && 'baz' == secondCondition ) {
location = 'https://www.example.com/thank-you-2/';
}
}, false );