LLMS_Emails::get_email( string $id, array $args = array() )
Retrieve a new instance of an email
Parameters Parameters
- $id
-
(string) (Required) Email id.
- $args
-
(array) (Optional) arguments to pass to the email.
Default value: array()
Return Return
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;
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 3.8.0 | Introduced. |