<?php

namespace RTMCustomMails\Preview;

use WordpressModels\Traits\SingletonTrait;

/**
 *
 */
class DisallowPreviews
{

    use SingletonTrait;

    public function __construct()
    {
        add_filter('wrce_disallow_preview_email_types', [$this, 'defaultDisallowList']);
    }

    /**
     * @param array $array
     * @return array
     */
    public function defaultDisallowList(array $array): array
    {
        return array_merge($array, [
            'WC_Email_New_Booking',
            'WC_Email_Booking_Reminder',
            'WC_Email_Booking_Confirmed',
            'WC_Email_Booking_Notification',
            'WC_Email_Booking_Cancelled',
            'WC_Email_Admin_Booking_Cancelled',
            'WC_Email_Booking_Pending_Confirmation',
            'WCS_Email_New_Renewal_Order',
            'WCS_Email_New_Switch_Order',
            'WCS_Email_Processing_Renewal_Order',
            'WCS_Email_Completed_Renewal_Order',
            'WCS_Email_Completed_Switch_Order',
            'WCS_Email_Customer_Renewal_Invoice',
            'WCS_Email_Cancelled_Subscription',
            'WCS_Email_Expired_Subscription',
            'WCS_Email_On_Hold_Subscription',
            'WC_Memberships_User_Membership_Note_Email',
            'WC_Memberships_User_Membership_Ending_Soon_Email',
            'WC_Memberships_User_Membership_Ended_Email',
            'WC_Memberships_User_Membership_Renewal_Reminder_Email',
        ]);
    }

}