| 1 |
<?php |
| 2 |
/** |
| 3 |
* Admin notice that a subscription was saved (free). |
| 4 |
* |
| 5 |
* The customer opened the cancellation flow and backed out. Throttled upstream |
| 6 |
* to once a day per subscription, so this never fires for someone idly opening |
| 7 |
* and closing the modal - see Illuminate\Cancellation::record_save(). |
| 8 |
* |
| 9 |
* @package SpringDevs\Subscription\Illuminate\Emails |
| 10 |
*/ |
| 11 |
|
| 12 |
namespace SpringDevs\Subscription\Illuminate\Emails; |
| 13 |
|
| 14 |
defined( 'ABSPATH' ) || exit; |
| 15 |
|
| 16 |
/** |
| 17 |
* Admin notice that a subscription was saved (free). |
| 18 |
*/ |
| 19 |
class SavedAdmin extends AdminCancellationEmail { |
| 20 |
|
| 21 |
/** |
| 22 |
* Initialize the class. |
| 23 |
*/ |
| 24 |
public function __construct() { |
| 25 |
$this->id = 'subscrpt_cancellation_saved_admin'; |
| 26 |
$this->title = __( 'Subscription saved ( Admin )', 'subscription' ); |
| 27 |
$this->description = __( 'Sent to the store owner when a customer starts cancelling and then keeps their subscription.', 'subscription' ); |
| 28 |
|
| 29 |
add_action( 'subscrpt_subscription_saved', array( $this, 'trigger' ), 10, 2 ); |
| 30 |
|
| 31 |
parent::__construct(); |
| 32 |
|
| 33 |
$this->template_html = 'emails/cancellation-saved-admin-html.php'; |
| 34 |
$this->template_plain = 'emails/plains/cancellation-saved-admin-plain.php'; |
| 35 |
} |
| 36 |
|
| 37 |
/** |
| 38 |
* Get default subject. |
| 39 |
* |
| 40 |
* @return string |
| 41 |
*/ |
| 42 |
public function get_default_subject() { |
| 43 |
return __( '[{site_title}] A subscription was saved', 'subscription' ); |
| 44 |
} |
| 45 |
|
| 46 |
/** |
| 47 |
* Get default heading. |
| 48 |
* |
| 49 |
* @return string |
| 50 |
*/ |
| 51 |
public function get_default_heading() { |
| 52 |
return __( 'A subscription was saved', 'subscription' ); |
| 53 |
} |
| 54 |
|
| 55 |
/** |
| 56 |
* Opening sentence of the mail. |
| 57 |
* |
| 58 |
* @return string |
| 59 |
*/ |
| 60 |
protected function get_intro() { |
| 61 |
return __( 'A customer started cancelling a subscription and then decided to keep it.', 'subscription' ); |
| 62 |
} |
| 63 |
} |
| 64 |
|