WC_GZD_Email_Customer_SEPA_Direct_Debit_Mandate

Direct debit mandate email.

Defined (1)

The class is defined in the following location(s).

/includes/emails/class-wc-gzd-email-customer-sepa-direct-debit-mandate.php  
  1. class WC_GZD_Email_Customer_SEPA_Direct_Debit_Mandate extends WC_Email { 
  2.  
  3. public $gateway = null; 
  4.  
  5. /** 
  6. * Constructor 
  7. * @access public 
  8. * @return void 
  9. */ 
  10. function __construct() { 
  11.  
  12. $this->id = 'customer_sepa_direct_debit_mandate'; 
  13. $this->title = __( 'SEPA Direct Debit Mandate', 'woocommerce-germanized' ); 
  14. $this->description = __( 'Email contains a copy of the SEPA mandate generated by information provided by the customer.', 'woocommerce-germanized' ); 
  15.  
  16. $this->template_html = 'emails/customer-sepa-direct-debit-mandate.php'; 
  17. $this->template_plain = 'emails/plain/customer-sepa-direct-debit-mandate.php'; 
  18.  
  19. $this->subject = __( 'SEPA Direct Debit Mandate', 'woocommerce-germanized' ); 
  20. $this->heading = __( 'SEPA Direct Debit Mandate', 'woocommerce-germanized' ); 
  21.  
  22. // Call parent constuctor 
  23. parent::__construct(); 
  24.  
  25. $this->customer_email = true; 
  26.  
  27. /** 
  28. * trigger function. 
  29. * @access public 
  30. * @return void 
  31. */ 
  32. function trigger( $order ) { 
  33.  
  34. if ( ! is_object( $order ) ) { 
  35. $order = wc_get_order( absint( $order ) ); 
  36.  
  37. if ( $order ) { 
  38. $this->object = $order; 
  39.  
  40. $gateways = WC()->payment_gateways()->payment_gateways(); 
  41. $this->gateway = $gateways[ 'direct-debit' ]; 
  42.  
  43. $this->recipient = wc_gzd_get_crud_data( $this->object, 'billing_email' ); 
  44.  
  45. $this->find['order-date'] = '{order_date}'; 
  46. $this->find['order-number'] = '{order_number}'; 
  47.  
  48. $this->replace['order-date'] = date_i18n( wc_date_format(), strtotime( wc_gzd_get_crud_data( $this->object, 'order_date' ) ) ); 
  49. $this->replace['order-number'] = $this->object->get_order_number(); 
  50.  
  51. if ( ! $this->is_enabled() || ! $this->get_recipient() ) 
  52. return; 
  53.  
  54. $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); 
  55.  
  56. /** 
  57. * get_content_html function. 
  58. * @access public 
  59. * @return string 
  60. */ 
  61. function get_content_html() { 
  62. ob_start(); 
  63. wc_get_template( $this->template_html, array( 
  64. 'order' => $this->object,  
  65. 'gateway' => $this->gateway,  
  66. 'email_heading' => $this->get_heading(),  
  67. 'blogname' => $this->get_blogname(),  
  68. 'sent_to_admin' => false,  
  69. 'plain_text' => false,  
  70. 'email' => $this 
  71. ) ); 
  72. return ob_get_clean(); 
  73.  
  74. /** 
  75. * get_content_plain function. 
  76. * @access public 
  77. * @return string 
  78. */ 
  79. function get_content_plain() { 
  80. ob_start(); 
  81. wc_get_template( $this->template_plain, array( 
  82. 'order' => $this->object,  
  83. 'gateway' => $this->gateway,  
  84. 'email_heading' => $this->get_heading(),  
  85. 'blogname' => $this->get_blogname(),  
  86. 'sent_to_admin' => false,  
  87. 'plain_text' => true,  
  88. 'email' => $this 
  89. ) ); 
  90. return ob_get_clean();