BP_Email::set_content_type( string $content_type )

Set the content type (HTML or plain text) to send the email in.


Parameters Parameters

$content_type

(string) (Required) Email content type ("html" or "plaintext").


Top ↑

Return Return

(BP_Email)


Source Source

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

	public function set_content_type( $content_type ) {
		if ( ! in_array( $content_type, array( 'html', 'plaintext', ), true ) ) {
			$class        = get_class_vars( get_class() );
			$content_type = $class['content_type'];
		}

		/**
		 * Filters the new value of the email's "content type" property.
		 *
		 * The content type (HTML or plain text) to send the email in.
		 *
		 * @since 2.5.0
		 *
		 * @param string $content_type Email content type ("html" or "plaintext").
		 * @param BP_Email $this Current instance of the email type class.
		 */
		$this->content_type = apply_filters( 'bp_email_set_content_type', $content_type, $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.