<?php
/**
 * Subscription Payment Retry Email
 * Sent to customer before a payment retry attempt.
 *
 * @package GGM_Commerce
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

class GGM_Commerce_Email_Subscription_Payment_Retry extends GGM_Commerce_Email_Subscription_Template {

	public function __construct() {
		$this->id             = 'subscription_payment_retry';
		$this->title          = __( 'Payment Retry Notice', 'ggm-commerce' );
		$this->description    = __( 'Sent to the customer before an automatic payment retry attempt.', 'ggm-commerce' );
		$this->recipient_type = 'customer';
	}

	public function get_default_subject() {
		return __( 'We will retry your payment for subscription #{subscription_number}', 'ggm-commerce' );
	}

	public function get_default_heading() {
		return __( 'Payment Retry Scheduled', 'ggm-commerce' );
	}

	public function get_default_content() {
		return '
<p>Hi {customer_first_name},</p>

<p>We were unable to process your last payment for subscription #{subscription_number}. We will automatically retry the payment on <strong>{retry_date}</strong> (attempt #{retry_number}).</p>
' . $this->render_subscription_details_block() . '

<p>To ensure your payment goes through, please verify that your payment method is up to date. You can update it from your account page.</p>

<p>If you need assistance, please contact us.</p>
';
	}
}
