BP_Signup::resend( array $signup_ids = array() )
Resend an activation email.
Description
Parameters
- $signup_ids
-
(array) (Optional) Single ID or list of IDs to resend.
Default value: array()
Return
(array)
Source
File: bp-members/classes/class-bp-signup.php
public static function resend( $signup_ids = array() ) { if ( empty( $signup_ids ) || ! is_array( $signup_ids ) ) { return false; } $to_resend = self::get( array( 'include' => $signup_ids, ) ); if ( ! $signups = $to_resend['signups'] ) { return false; } $result = array(); /** * Fires before activation emails are resent. * * @since BuddyPress 2.0.0 * * @param array $signup_ids Array of IDs to resend activation emails to. */ do_action( 'bp_core_signup_before_resend', $signup_ids ); foreach ( $signups as $signup ) { $meta = $signup->meta; $meta['sent_date'] = current_time( 'mysql', true ); $meta['count_sent'] = $signup->count_sent + 1; // Send activation email. if ( is_multisite() ) { wpmu_signup_user_notification( $signup->user_login, $signup->user_email, $signup->activation_key, serialize( $meta ) ); } else { // Check user status before sending email. $user_id = email_exists( $signup->user_email ); if ( ! empty( $user_id ) && 2 != self::check_user_status( $user_id ) ) { // Status is not 2, so user's account has been activated. $result['errors'][ $signup->signup_id ] = array( $signup->user_login, esc_html__( 'the sign-up has already been activated.', 'buddyboss' ) ); // Repair signups table. self::validate( $signup->activation_key ); continue; // Send the validation email. } else { bp_core_signup_send_validation_email( false, $signup->user_email, $signup->activation_key, $signup->user_login ); } } // Update metas. $result['resent'][] = self::update( array( 'signup_id' => $signup->signup_id, 'meta' => $meta, ) ); } /** * Fires after activation emails are resent. * * @since BuddyPress 2.0.0 * * @param array $signup_ids Array of IDs to resend activation emails to. * @param array $result Updated metadata related to activation emails. */ do_action( 'bp_core_signup_after_resend', $signup_ids, $result ); /** * Filters the result of the metadata for signup activation email resends. * * @since BuddyPress 2.0.0 * * @param array $result Updated metadata related to activation emails. */ return apply_filters( 'bp_core_signup_resend', $result ); }
Changelog
Version | Description |
---|---|
BuddyPress 2.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.