WC_GZD_Email_Customer_Ekomi

EKomi Review Reminder Email.

Defined (1)

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

/includes/emails/class-wc-gzd-email-customer-ekomi.php  
  1. class WC_GZD_Email_Customer_Ekomi extends WC_Email { 
  2.  
  3. /** 
  4. * Constructor 
  5. */ 
  6. function __construct() { 
  7.  
  8. $this->id = 'customer_ekomi'; 
  9. $this->title = _x( 'eKomi Review Reminder', 'ekomi', 'woocommerce-germanized' ); 
  10. $this->description = _x( 'This E-Mail is being sent to a customer to transfer eKomi order review link to a customer.', 'ekomi', 'woocommerce-germanized' ); 
  11.  
  12. $this->heading = _x( 'Please rate your Order', 'ekomi', 'woocommerce-germanized' ); 
  13. $this->subject = _x( 'Please rate your {site_title} order from {order_date}', 'ekomi', 'woocommerce-germanized' ); 
  14.  
  15. $this->template_html = 'emails/customer-ekomi.php'; 
  16. $this->template_plain = 'emails/plain/customer-ekomi.php'; 
  17.  
  18. // Triggers for this email 
  19. add_action( 'woocommerce_germanized_ekomi_review_notification', array( $this, 'trigger' ) ); 
  20.  
  21. // Call parent constuctor 
  22. parent::__construct(); 
  23.  
  24. $this->customer_email = true; 
  25.  
  26. /** 
  27. * trigger function. 
  28. * @access public 
  29. * @return void 
  30. */ 
  31. function trigger( $order_id ) { 
  32.  
  33. if ( $order_id ) { 
  34. $this->object = wc_get_order( $order_id ); 
  35. $this->recipient = $this->object->billing_email; 
  36.  
  37. $this->find['order-date'] = '{order_date}'; 
  38. $this->find['order-number'] = '{order_number}'; 
  39.  
  40. $this->replace['order-date'] = date_i18n( wc_date_format(), strtotime( $this->object->order_date ) ); 
  41. $this->replace['order-number'] = $this->object->get_order_number(); 
  42.  
  43. if ( ! $this->is_enabled() || ! $this->get_recipient() ) { 
  44. return; 
  45.  
  46. $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); 
  47.  
  48. /** 
  49. * get_content_html function. 
  50. * @access public 
  51. * @return string 
  52. */ 
  53. function get_content_html() { 
  54. ob_start(); 
  55. wc_get_template( $this->template_html, array( 
  56. 'order' => $this->object,  
  57. 'email_heading' => $this->get_heading(),  
  58. 'sent_to_admin' => false,  
  59. 'plain_text' => false,  
  60. 'email' => $this 
  61. ) ); 
  62. return ob_get_clean(); 
  63.  
  64. /** 
  65. * get_content_plain function. 
  66. * @access public 
  67. * @return string 
  68. */ 
  69. function get_content_plain() { 
  70. ob_start(); 
  71. wc_get_template( $this->template_plain, array( 
  72. 'order' => $this->object,  
  73. 'email_heading' => $this->get_heading(),  
  74. 'sent_to_admin' => false,  
  75. 'plain_text' => true,  
  76. 'email' => $this 
  77. ) ); 
  78. return ob_get_clean(); 
  79.