Hi @1jd123
Our Second Level Support team has provided a custom code that can help resend the activation mail.
You’ll need to add a must-use plugin to your site’s wp-content/mu-plugins folder as explained in our documentation here: https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins, then add the following code provided to the plugin’s php file:
add_action('admin_init', 'wpmudev_resend_activation_link');
function wpmudev_resend_activation_link() {
if ( ! current_user_can( 'manage_options' ) ) {
return;
}
if ( isset( $_GET['page'] ) ) {
if ( $_GET['page'] == 'forminator-entries' && isset( $_GET['form_id'] ) ) {
if ( ! isset( $_GET['formi_resend_notification'] ) ) {
return;
}
global $wpdb;
$form_id = $_GET['form_id'];
$table_name = Forminator_Database_Tables::get_table_name( Forminator_Database_Tables::FORM_ENTRY_META );
$entry_table_name = Forminator_Database_Tables::get_table_name( Forminator_Database_Tables::FORM_ENTRY );
$sql = "SELECT m.
meta_value
FROM {$table_name} m LEFT JOIN {$entry_table_name} e ON(e.entry_id
= m.entry_id
) WHERE e.form_id
= %d AND m.meta_key
= %s AND ( e.draft_id IS NULL OR e.draft_id = '' ) AND e.is_spam
= 0 order by m.meta_id
";
$entry_ids = $wpdb->get_results( $wpdb->prepare( $sql, $form_id, 'activation_key' ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
if ( ! empty( $entry_ids ) ) {
foreach ( $entry_ids as $entry ) {
$activation_key = $entry->meta_value;
if ( ! empty( $activation_key ) ) {
$url = add_query_arg(
array(
'page' => 'account_activation',
'key' => $activation_key,
),
home_url( '/' )
);
$signup = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->base_prefix}signups WHERE activation_key = %s", $activation_key ) );
if ( ! $signup->active ) {
$username = $signup->user_login;
$recipient = $signup->user_email;
$urlparts = parse_url( home_url() );
$domain = $urlparts['host'];
$headers = array(
'Content-Type: text/html; charset=UTF-8',
'From: ' . html_entity_decode( get_bloginfo( 'name' ), ENT_QUOTES ) . ' <admin@' . $domain . '>',
);
$subject = sprintf( esc_html__( 'Activation link for %s', 'forminator' ), $username );
$message = '<p>' . esc_html__( 'To activate your user account, please click the following link:', 'forminator' ) . '</p>';
$message .= '<p>' . esc_url_raw( $url ) . '</p>';
$message .= '<p>' . esc_html__( 'After you activate, you will receive *another email* with your login.', 'forminator' ) . '</p>';
if ( ! empty( $recipient ) && ! empty( $subject ) && ! empty( $message ) ) {
$sent = wp_mail( $recipient, $subject, $message, $headers );
}
}
}
}
}
}
}
}
After adding the snippet, need to visit the entries/submission page for instance (replace https://mylocal.loca with your domain):
https://mylocal.local/wp-admin/admin.php?page=forminator-entries&form_type=forminator_forms&form_id=3461&paged=1
Add an extra parameter formi_resend_notification
to trigger resending the notifications. So, the final URL should be like this
https://mylocal.local/wp-admin/admin.php?page=forminator-entries&form_type=forminator_forms&form_id=3461&paged=1&formi_resend_notification
Important: The form ID will be different (replace 3461 with your form id). Once page is reloaded, remove the formi_resend_notification
parameter from the URL or else it will re-send all the notifications again.
Hope this information helps. Feel free to reply if you have further questions or concerns.
Kind regards
Luis