bp_send_welcome_email( int $user_id )

Send welcome email on successful user activation.


Parameters Parameters

$user_id

(int) (Required) The new user's ID


Source Source

File: bp-members/bp-members-functions.php

function bp_send_welcome_email( $user_id = 0 ) {
	if ( ! $user_id ) {
		return;
	}

	$profile_url = bp_core_get_user_domain( $user_id );

	/**
	 * Use this filter to add/edit/remove tokens to use for your welcome email.
	 *
	 * @since 8.0.0
	 *
	 * @param array $value   An array of BP Email tokens.
	 * @param int   $user_id The user ID.
	 */
	$welcome_tokens = apply_filters(
		'bp_send_welcome_email_tokens',
		array(
			'displayname'      => bp_core_get_user_displayname( $user_id ),
			'profile.url'      => $profile_url,
			'lostpassword.url' => wp_lostpassword_url( $profile_url ),
		),
		$user_id
	);

	bp_send_email( 'core-user-activation', $user_id, array( 'tokens' => $welcome_tokens ) );
}


Top ↑

Changelog Changelog

Changelog
Version Description
8.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.