LLMS_Emails::get_email( string $id, array $args = array() )

Retrieve a new instance of an email

Parameters Parameters


(string) (Required) Email id.


(array) (Optional) arguments to pass to the email.

Default value: array()

Top ↑

Return Return


Top ↑

Source Source

File: includes/class.llms.emails.php

	public function get_email( $id, $args = array() ) {

		$emails = $this->get_emails();

		// If we have an email matching the ID, return an instance of that email class.
		if ( isset( $emails[ $id ] ) ) {
			return new $emails[ $id ]( $args );

		// Otherwise return a generic email and set the ID to be the requested ID.
		/** @var LLMS_Email $generic */
		$generic = new $emails['generic']( $args );
		$generic->set_id( $id );
		return $generic;


Top ↑

Changelog Changelog

Version Description
3.8.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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