Code Duplication    Length = 20-20 lines in 2 locations

includes/compat/class-wc-stripe-email-failed-preorder-authentication.php 1 location

@@ 24-43 (lines=20) @@
21
	 *
22
	 * @param WC_Email[] $email_classes All existing instances of WooCommerce emails.
23
	 */
24
	public function __construct( $email_classes = array() ) {
25
		$this->id             = 'failed_preorder_sca_authentication';
26
		$this->title          = __( 'Pre-order Payment Action Needed', 'woocommerce-gateway-stripe' );
27
		$this->description    = __( 'This is an order notification sent to the customer once a pre-order is complete, but additional payment steps are required.', 'woocommerce-gateway-stripe' );
28
		$this->customer_email = true;
29
30
		$this->template_html  = 'emails/failed-preorder-authentication.php';
31
		$this->template_plain = 'emails/plain/failed-preorder-authentication.php';
32
		$this->template_base  = plugin_dir_path( WC_STRIPE_MAIN_FILE ) . 'templates/';
33
34
		// Use the "authentication required" hook to add the correct, later hook.
35
		add_action( 'wc_gateway_stripe_process_payment_authentication_required', array( $this, 'trigger' ) );
36
37
		if ( isset( $email_classes['WC_Pre_Orders_Email_Pre_Order_Available'] ) ) {
38
			$this->original_email = $email_classes['WC_Pre_Orders_Email_Pre_Order_Available'];
39
		}
40
41
		// We want all the parent's methods, with none of its properties, so call its parent's constructor, rather than my parent constructor.
42
		parent::__construct();
43
	}
44
45
	/**
46
	 * When autnentication is required, this adds another action to `wc_pre_orders_pre_order_completed`

includes/compat/class-wc-stripe-email-failed-renewal-authentication.php 1 location

@@ 17-36 (lines=20) @@
14
	 *
15
	 * @param WC_Email[] $email_classes All existing instances of WooCommerce emails.
16
	 */
17
	public function __construct( $email_classes = array() ) {
18
		$this->id             = 'failed_renewal_authentication';
19
		$this->title          = __( 'Failed Subscription Renewal SCA Authentication', 'woocommerce-gateway-stripe' );
20
		$this->description    = __( 'Sent to a customer when a renewal fails because the transaction requires an SCA verification. The email contains renewal order information and payment links.', 'woocommerce-gateway-stripe' );
21
		$this->customer_email = true;
22
23
		$this->template_html  = 'emails/failed-renewal-authentication.php';
24
		$this->template_plain = 'emails/plain/failed-renewal-authentication.php';
25
		$this->template_base  = plugin_dir_path( WC_STRIPE_MAIN_FILE ) . 'templates/';
26
27
		// Triggers the email at the correct hook.
28
		add_action( 'wc_gateway_stripe_process_payment_authentication_required', array( $this, 'trigger' ) );
29
30
		if ( isset( $email_classes['WCS_Email_Customer_Renewal_Invoice'] ) ) {
31
			$this->original_email = $email_classes['WCS_Email_Customer_Renewal_Invoice'];
32
		}
33
34
		// We want all the parent's methods, with none of its properties, so call its parent's constructor, rather than my parent constructor.
35
		parent::__construct();
36
	}
37
38
	/**
39
	 * Triggers the email while also disconnecting the original Subscriptions email.