WC_Email::get_email_type
Return email type.
Method of the class: WC_Email{}
Hooks from the method
Returns
String.
Usage
$WC_Email = new WC_Email(); $WC_Email->get_email_type();
WC_Email::get_email_type() WC Email::get email type code WC 10.7.0
public function get_email_type() {
$email_type = $this->email_type;
/**
* This filter is documented in templates/emails/email-styles.php
*
* @since 9.6.0
* @param bool $is_email_preview Whether the email is being previewed.
*/
$is_email_preview = apply_filters( 'woocommerce_is_email_preview', false );
// Transient is used for live email preview without saving the settings.
if ( $is_email_preview ) {
$transient = get_transient( "woocommerce_{$this->id}_email_type" );
$email_type = $transient ? $transient : $email_type;
}
return $email_type && class_exists( 'DOMDocument' ) ? $email_type : 'plain';
}