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()


Top ↑

Return Return

(LLMS_Email)


Top ↑

Source Source

File: includes/class.llms.emails.php

172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
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

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.