Hi @squeebo
I hope you are doing well.
We don’t have a native option for that but I pinged our developers to verify if we can find a workaround for you.
We will keep you posted.
Best Regards
Patrick Freitas
Hi @squeebo
Could you please try
<?php
add_action( 'plugins_loaded', function() {
if ( ! defined( 'FORMINATOR_VERSION' ) ) {
return; // Forminator is not installed/enabled.
}
add_filter( 'forminator_form_get_admin_email_recipients', function( $email, $notification, $prepared_data, $module, $entry ) {
if ( empty( $email ) || ! is_array( $email ) || 1 === count( $email ) ) {
return $email;
}
// >>> SETTINGS [BEGIN]
$form_id = 6; // Target form ID.
$random = false; // Set to TRUE to use a random approach.
// <<< SETTINGS [END]
if ( $form_id !== $module->id ) {
return $email;
}
$count = count( $email );
$rand_email = array(
$email[ rand( 0, $count - 1 ) ]
);
if ( $random ) {
return $rand_email;
}
$entry_id = $entry->entry_id;
$index = ( $entry_id % $count ) - 1;
$index = -1 === $index ? ( $count - 1 ) : $index;
$next_email = isset( $email[ $index ] ) ? array( $email[ $index ] ) : $rand_email;
return $next_email;
}, 10, 5 );
});
Replace $form_id by the target form and set $random as TRUE to enable the random email selection.
Example Recipients field:
https://monosnap.com/file/RMu3uZNFcepBLqt0BqUO6sw44XRsvH
Let us know the result you got.
Best Regards
Patrick Freitas
Hi @squeebo
Just a small update in the screenshot link https://monosnap.com/file/tqj7pd2osxRKFBKBX9GZCkWDvbv2IJ
Best Regards
Patrick Freitas
Hello @squeebo ,
We haven’t heard from you for several days now, so it looks like you no longer need our assistance.
Feel free to re-open this ticket if needed.
Kind regards
Kasia