WC_Email_Admin_Payment_Gateway_Enabled::block_content
Output dynamic block content for this email.
Hooked into woocommerce_email_general_block_content render the gateway title, security notice, and gateway settings URL inside the ##WOO_CONTENT## area.
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->block_content( $sent_to_admin, $plain_text, $email ): void;
- $sent_to_admin(true|false) (required)
- Whether the email is being sent to admin.
- $plain_text(true|false) (required)
- Whether the email is being sent as plain text.
- $email(WC_Email) (required)
- The email object.
Changelog
| Since 10.6.0 | Introduced. |
WC_Email_Admin_Payment_Gateway_Enabled::block_content() WC Email Admin Payment Gateway Enabled::block content code WC 10.7.0
<?php
public function block_content( $sent_to_admin, $plain_text, $email ): void {
if ( $this->id !== $email->id ) {
return;
}
$gateway_title = ! empty( $this->gateway_title ) ? $this->gateway_title : __( 'Dummy Gateway', 'woocommerce' );
$gateway_settings_url = ! empty( $this->gateway_settings_url ) ? $this->gateway_settings_url : __( 'Dummy Settings URL', 'woocommerce' );
// phpcs:disable Squiz.PHP.EmbeddedPhp.ContentBeforeOpen -- Template-like output.
// phpcs:disable Squiz.PHP.EmbeddedPhp.ContentAfterEnd -- Template-like output.
?>
<p><?php
/* translators: %s: gateway title */
printf( esc_html__( 'The payment gateway "%s" has been enabled.', 'woocommerce' ), esc_html( $gateway_title ) );
?></p>
<p><?php esc_html_e( 'If you did not enable this payment gateway, please log in to your site and consider disabling it here:', 'woocommerce' ); ?></p>
<p><a href="<?php echo esc_url( $gateway_settings_url ); ?>"><?php echo esc_url( $gateway_settings_url ); ?></a></p>
<?php
// phpcs:enable Squiz.PHP.EmbeddedPhp.ContentBeforeOpen
// phpcs:enable Squiz.PHP.EmbeddedPhp.ContentAfterEnd
}