BP_Email::set_from( string|array|int|WP_User $email_address, string $name = '' )

Set the email’s “from” address and name.


Description Description


Parameters Parameters

$email_address

(Required) Either a email address, user ID, or WP_User object.

$name

(Optional) If $email_address is a string, this is the recipient's name.

Default value: ''


Top ↑

Return Return

(BP_Email)


Top ↑

Source Source

File: bp-core/classes/class-bp-email.php

	public function set_from( $email_address, $name = '' ) {
		$from = new BP_Email_Sender();

		$from->set_address( $email_address );
		$from->set_name( $name );

		/**
		 * Filters the new value of the email's "from" property.
		 *
		 * @since 2.5.0
		 *
		 * @param BP_Email_Recipient $from Sender details.
		 * @param string|array|int|WP_User $email_address Either a email address, user ID, or WP_User object.
		 * @param string $name Optional. If $email_address is a string, this is the recipient's name.
		 * @param BP_Email $this Current instance of the email type class.
		 */
		$this->from = apply_filters( 'bp_email_set_from', $from, $email_address, $name, $this );

		return $this;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
2.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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