WC_Email_Admin_Payment_Gateway_Enabled::__construct
Constructor.
Method of the class: WC_Email_Admin_Payment_Gateway_Enabled{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_Email_Admin_Payment_Gateway_Enabled = new WC_Email_Admin_Payment_Gateway_Enabled(); $WC_Email_Admin_Payment_Gateway_Enabled->__construct();
WC_Email_Admin_Payment_Gateway_Enabled::__construct() WC Email Admin Payment Gateway Enabled:: construct code WC 10.8.1
public function __construct() {
$this->id = 'admin_payment_gateway_enabled';
$this->title = __( 'Payment gateway enabled', 'woocommerce' );
$this->email_group = 'payments';
$this->template_html = 'emails/admin-payment-gateway-enabled.php';
$this->template_plain = 'emails/plain/admin-payment-gateway-enabled.php';
$this->placeholders = array(
'{gateway_title}' => '',
'{site_title}' => '',
);
// Trigger for this email.
add_action( 'woocommerce_payment_gateway_enabled_notification', array( $this, 'trigger' ), 10, 1 );
// Block email editor hooks.
add_action( 'woocommerce_email_general_block_content', array( $this, 'block_content' ), 10, 3 );
add_filter( 'woocommerce_emails_general_block_content_emails_without_order_details', array( $this, 'exclude_from_order_details' ) );
// Call parent constructor.
parent::__construct();
// Must be after parent's constructor which sets `email_improvements_enabled` and `block_email_editor_enabled` properties.
$this->description = __( 'Payment gateway enabled emails are sent to chosen recipient(s) when a payment gateway is enabled.', 'woocommerce' );
if ( $this->block_email_editor_enabled ) {
$this->description = __( 'Notifies admins when a payment gateway has been enabled.', 'woocommerce' );
}
// Other settings.
$this->recipient = $this->get_option( 'recipient', get_option( 'admin_email' ) );
}