1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
<?php
namespace AutomateWoo;
if ( ! defined( 'ABSPATH' ) ) { exit; }
/** * @class Action_Subscription_Send_Invoice * @since 3.5.0 */ class Action_Subscription_Send_Invoice extends Action {
/** @var string[] */ public $required_data_items = [ 'subscription' ];
/** * Method to set the action's admin props. * * Admin props include: title, group and description. */ public function load_admin_details() { $this->title = __( 'Send Invoice', 'automatewoo' ); $this->description = __( 'Email the invoice to the subscription customer.', 'automatewoo' ); $this->group = __( 'Subscription', 'automatewoo' ); }
/** * Run the action. */ public function run() { $subscription = $this->workflow->data_layer()->get_subscription(); if ( ! $subscription ) { return; }
do_action( 'woocommerce_before_resend_order_emails', $subscription, 'customer_invoice' );
WC()->payment_gateways(); WC()->shipping(); WC()->mailer()->customer_invoice( $subscription );
do_action( 'woocommerce_after_resend_order_email', $subscription, 'customer_invoice' ); } }
|