Form does not send to dynamic email
-
Hi there,
I have a hidden field on my form, which I gave the value of an email address. I’ve set the Email notification so that it sends to the value of this hidden field. I can confirm in Mailhog that the email is sending.
I’ve then added some code which dynamically changes the hidden input’s value using the value of an ACF field on the page
add_filter( 'forminator_field_hidden_field_value', function( $value, $saved_value, $field ){ ? ? $hidden_field_id = 'hidden-1'; ? ? $post_id = get_the_ID(); ? ? $advisor = get_field('new_home_advisor', $post_id); ? ? $email = get_field('email', $advisor->ID); ? ? if ( $hidden_field_id == $field[ 'element_id' ] ) { ? ? ? ? $value = $email; ? ? } ? ? return $value; }, 20, 3 );
When I inspect the HTML, I can confirm that the new value is set, but submitting the form does not send the email.
<input type="hidden" id="hidden-1_6594f1c7ad381" name="hidden-1" value="[email protected]">
I wonder if changing the value alone isn’t enough? Does Forminator’s submit also make use of the id of this input in some way. If not, I wonder what I’m missing?
Thanks,
Jay
- The topic ‘Form does not send to dynamic email’ is closed to new replies.