| 1 |
<?php |
| 2 |
|
| 3 |
namespace Better_Payment\Lite\WooCommerce\Emails; |
| 4 |
|
| 5 |
use Better_Payment\Lite\WooCommerce\Emails; |
| 6 |
|
| 7 |
/** |
| 8 |
* Exit if accessed directly |
| 9 |
*/ |
| 10 |
if ( ! defined( 'ABSPATH' ) ) { |
| 11 |
exit; |
| 12 |
} |
| 13 |
|
| 14 |
/** |
| 15 |
* Customer email: a Better Payment subscription was cancelled. |
| 16 |
* |
| 17 |
* Triggered by Emails::send_cancelled_email() after the grace delay — a |
| 18 |
* subscription reactivated during the window never reaches this class |
| 19 |
* (see the Emails registrar for the two-layer reactivation guard). |
| 20 |
* |
| 21 |
* @since 2.4.0 |
| 22 |
*/ |
| 23 |
class SubscriptionCancelledEmail extends SubscriptionEmail { |
| 24 |
|
| 25 |
/** |
| 26 |
* Set up the email row shown under WooCommerce → Settings → Emails. |
| 27 |
*/ |
| 28 |
public function __construct() { |
| 29 |
$this->id = Emails::CANCELLED_EMAIL_ID; |
| 30 |
$this->title = __( 'Better Payment Subscription Cancelled', 'better-payment' ); |
| 31 |
$this->description = __( 'Sent to the customer when their Better Payment subscription is cancelled and no further renewals will be charged. The send is delayed briefly so a reactivated subscription is never emailed about a cancellation.', 'better-payment' ); |
| 32 |
|
| 33 |
parent::__construct(); |
| 34 |
} |
| 35 |
|
| 36 |
/** |
| 37 |
* The notification hook Emails::notify() fires for this email. |
| 38 |
* |
| 39 |
* @return string |
| 40 |
*/ |
| 41 |
protected function notification_hook() { |
| 42 |
return Emails::CANCELLED_NOTIFICATION; |
| 43 |
} |
| 44 |
|
| 45 |
/** |
| 46 |
* Default subject line. |
| 47 |
* |
| 48 |
* @return string |
| 49 |
*/ |
| 50 |
public function get_default_subject() { |
| 51 |
return __( 'Your {site_title} subscription (order {order_number}) has been cancelled', 'better-payment' ); |
| 52 |
} |
| 53 |
|
| 54 |
/** |
| 55 |
* Default email heading. |
| 56 |
* |
| 57 |
* @return string |
| 58 |
*/ |
| 59 |
public function get_default_heading() { |
| 60 |
return __( 'Subscription cancelled', 'better-payment' ); |
| 61 |
} |
| 62 |
|
| 63 |
/** |
| 64 |
* Default closing copy (editable per-email in the settings row). |
| 65 |
* |
| 66 |
* @return string |
| 67 |
*/ |
| 68 |
public function get_default_additional_content() { |
| 69 |
return __( 'Changed your mind? You can subscribe again from our store at any time.', 'better-payment' ); |
| 70 |
} |
| 71 |
} |
| 72 |
|