Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  • Hook Reference
  • Docs Home

Packages

  • None
  • Order-Delivery-Date-Pro-for-WooCommerce
    • Admin
      • Edit-Order
      • Non-Sensitive-Data-Capture
      • Settings
        • Custom-Delivery
        • General
        • Google-Calendar-Sync
    • Class-ORDDD-Email-Manager
    • Common-Functions
    • Delivery-Calendar
    • Emails
      • Class-ORDDD-Email-Update-Date
    • Filter
    • Frontend
      • Checkout-Page-Processes
      • ICS-Files-Data
    • Google-Calendar
    • Integration
    • Lang
    • License
    • Plugin-Updates
      • EDD-SL-Plugin-Updater

Classes

  • EDD_SL_Plugin_Updater
  • orddd_additional_settings
  • orddd_admin_delivery_class
  • orddd_appearance_settings
  • orddd_calendar_sync
  • orddd_calendar_sync_settings
  • orddd_class_view_deliveries
  • orddd_common
  • orddd_date_settings
  • orddd_delivery_days_settings
  • ORDDD_Email_Manager
  • ORDDD_Email_Update_Date
  • orddd_filter
  • orddd_holidays_settings
  • orddd_integration
  • orddd_license
  • orddd_process
  • orddd_settings
  • orddd_shipping_based_settings
  • orddd_shipping_days_settings
  • orddd_shipping_multiple_address
  • orddd_time_settings
  • orddd_time_slot_settings
  • ORDDD_View_Delivery_Dates_Table
  • ORDDD_View_Disable_Time_Slots_Table
  • ORDDD_View_Holidays_Table
  • ORDDD_View_Shipping_Settings_Table
  • ORDDD_View_Time_Slots_Table
  • OrdddGcal
  • order_delivery_date
  • TS_Tracker
  • TS_tracking

Functions

  • orddd_get_dateToCal
  • orddd_get_escapeString
  • orddd_t
 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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 
<?php 
/**
 * Order Delivery Date Pro for WooCommerce
 *
 *
 * Handles email sending
 *
 * @author      Tyche Softwares
 * @package     Order-Delivery-Date-Pro-for-WooCommerce/Class-ORDDD-Email-Manager
 * @since       5.7
 */

/**
 * ORDDD_Email_Manager Class
 *
 * @class ORDDD_Email_Manager
 */
class ORDDD_Email_Manager {

    /**
     * Constructor sets up hooks to add the 
     * email actions to WooCommerce emails.
     * 
     * @since 5.7
     */
    public function __construct() {
        add_filter( 'woocommerce_email_classes', array( &$this, 'bkap_init_emails' ) );
        
        // Email Actions
        $email_actions = array(
            'orddd_admin_update_date',
         );

        foreach ( $email_actions as $action ) {
            add_action( $action, array( 'WC_Emails', 'send_transactional_email' ), 10, 10 );
        }
        
        add_filter( 'woocommerce_template_directory', array( $this, 'bkap_template_directory' ), 10, 2 );
        
    }
    
    /**
     * Adds the Email class file to ensure the emails
     * from the plugin are fired based on the settings.
     * 
     * @param array $emails - List of Emails already setup by WooCommerce
     * @return array $emails - List of Emails with the ones from the plugin included.
     *  
     * @hook woocommerce_email_classes
     * @since 5.7
     */
    public function bkap_init_emails( $emails ) {
        if ( ! isset( $emails[ 'ORDDD_Email_Update_Date' ] ) ) {
            $emails[ 'ORDDD_Email_Update_Date' ] = include( 'emails/class-orddd-email-update-date.php' );
        }
        return $emails;
    }
    
    /**
     * Returns the directory name in which the template file is present.
     * 
     * @param string $directory - Directory Name in which the template is present.
     * @param string $template - Email Template File Name
     * @return string $directory - Directory Name in which the template is present. Modified when the template is for our plugin.
     * 
     * @hook woocommerce_template_directory
     * @since 5.7
     */
    public function bkap_template_directory( $directory, $template ) {
        if ( false !== strpos( $template, 'order-' ) ) {
            return 'order-delivery-date';
        }
    
        return $directory;
    }
    
    /**
     * Adds a hook to fire the delivery date/time edit email notice.
     * 
     * @param integer $order_id - Order ID for which the Delivery Date/Time is edited.
     * @param string $updated_by - States by whom are the details being updated. Valid Values: admin|customer 
     * 
     * @since 6.8
     */
    public static function orddd_send_email_on_update( $order_id, $updated_by ) {
            new WC_Emails();
            do_action( 'orddd_admin_update_date_notification', $order_id, $updated_by );
       
    }
}// end of class
new ORDDD_Email_Manager();
?>
API documentation generated by ApiGen