WC_GZD_Email_Customer_Trusted_Shops

EKomi Review Reminder Email.

Defined (1)

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

/includes/emails/class-wc-gzd-email-customer-trusted-shops.php  
  1. class WC_GZD_Email_Customer_Trusted_Shops extends WC_Email { 
  2.  
  3. /** 
  4. * Constructor 
  5. */ 
  6. function __construct() { 
  7.  
  8. $this->id = 'customer_trusted_shops'; 
  9. $this->title = _x( 'Trusted Shops Review Reminder', 'trusted-shops', 'woocommerce-germanized' ); 
  10. $this->description = _x( 'This E-Mail is being sent to a customer to remind him about the possibility to leave a review at Trusted Shops.', 'trusted-shops', 'woocommerce-germanized' ); 
  11.  
  12. $this->heading = _x( 'Please rate your Order', 'trusted-shops', 'woocommerce-germanized' ); 
  13. $this->subject = _x( 'Please rate your {site_title} order from {order_date}', 'trusted-shops', 'woocommerce-germanized' ); 
  14.  
  15. $this->template_html = 'emails/customer-trusted-shops.php'; 
  16. $this->template_plain = 'emails/plain/customer-trusted-shops.php'; 
  17.  
  18.  
  19. // Triggers for this email 
  20. add_action( 'woocommerce_germanized_trusted_shops_review_notification', array( $this, 'trigger' ) ); 
  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_id ) { 
  33.  
  34. if ( $order_id ) { 
  35. $this->object = wc_get_order( $order_id ); 
  36. $this->recipient = wc_gzd_get_crud_data( $this->object, 'billing_email' ); 
  37.  
  38. $this->find['order-date'] = '{order_date}'; 
  39. $this->find['order-number'] = '{order_number}'; 
  40.  
  41. $this->replace['order-date'] = date_i18n( wc_date_format(), strtotime( wc_gzd_get_crud_data( $this->object, 'order_date' ) ) ); 
  42. $this->replace['order-number'] = $this->object->get_order_number(); 
  43.  
  44. if ( ! $this->is_enabled() || ! $this->get_recipient() ) { 
  45. return; 
  46.  
  47. $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); 
  48.  
  49. /** 
  50. * get_content_html function. 
  51. * @access public 
  52. * @return string 
  53. */ 
  54. function get_content_html() { 
  55. ob_start(); 
  56. wc_get_template( $this->template_html, array( 
  57. 'order' => $this->object,  
  58. 'email_heading' => $this->get_heading(),  
  59. 'sent_to_admin' => false,  
  60. 'plain_text' => false,  
  61. 'email' => $this 
  62. ) ); 
  63. return ob_get_clean(); 
  64.