WC_GZD_Email_Customer_New_Account_Activation

Customer New Account.

Defined (1)

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

/includes/emails/class-wc-gzd-email-customer-new-account-activation.php  
  1. class WC_GZD_Email_Customer_New_Account_Activation extends WC_Email { 
  2.  
  3. public $user_login; 
  4. public $user_email; 
  5. public $user_activation; 
  6. public $user_activation_url; 
  7. public $user_pass; 
  8. public $password_generated; 
  9.  
  10. /** 
  11. * Constructor 
  12. * @access public 
  13. * @return void 
  14. */ 
  15. function __construct() { 
  16.  
  17. $this->id = 'customer_new_account_activation'; 
  18. $this->title = __( 'New account activation', 'woocommerce-germanized' ); 
  19. $this->description = __( 'Customer "new account activation" emails are sent to the customer when a customer signs up via checkout or account pages. This mail is being used as double opt in for new customer accounts.', 'woocommerce-germanized' ); 
  20.  
  21. $this->template_html = 'emails/customer-new-account-activation.php'; 
  22. $this->template_plain = 'emails/plain/customer-new-account-activation.php'; 
  23.  
  24. $this->subject = __( 'Activate your account on {site_title}', 'woocommerce-germanized'); 
  25. $this->heading = __( 'Account activation {site_title}', 'woocommerce-germanized'); 
  26.  
  27. // Call parent constuctor 
  28. parent::__construct(); 
  29.  
  30. $this->customer_email = true; 
  31.  
  32. /** 
  33. * trigger function. 
  34. * @access public 
  35. * @return void 
  36. */ 
  37. function trigger( $user_id, $user_activation, $user_activation_url, $user_pass = '', $password_generated = false ) { 
  38.  
  39. if ( $user_id ) { 
  40. $this->object = new WP_User( $user_id ); 
  41.  
  42. $this->user_pass = $user_pass; 
  43. $this->user_activation = $user_activation; 
  44. $this->user_activation_url = $user_activation_url; 
  45. $this->user_login = stripslashes( $this->object->user_login ); 
  46. $this->user_email = stripslashes( $this->object->user_email ); 
  47. $this->recipient = $this->user_email; 
  48. $this->password_generated = $password_generated; 
  49.  
  50. if ( ! $this->is_enabled() || ! $this->get_recipient() ) 
  51. return; 
  52.  
  53. $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); 
  54.  
  55. /** 
  56. * get_content_html function. 
  57. * @access public 
  58. * @return string 
  59. */ 
  60. function get_content_html() { 
  61. ob_start(); 
  62. wc_get_template( $this->template_html, array( 
  63. 'email_heading' => $this->get_heading(),  
  64. 'user_login' => $this->user_login,  
  65. 'user_activation' => $this->user_activation,  
  66. 'user_activation_url' => $this->user_activation_url,  
  67. 'user_pass' => $this->user_pass,  
  68. 'password_generated' => $this->password_generated,  
  69. 'blogname' => $this->get_blogname(),  
  70. 'sent_to_admin' => false,  
  71. 'plain_text' => false,  
  72. 'email' => $this 
  73. ) ); 
  74. return ob_get_clean(); 
  75.  
  76. /** 
  77. * get_content_plain function. 
  78. * @access public 
  79. * @return string 
  80. */ 
  81. function get_content_plain() { 
  82. ob_start(); 
  83. wc_get_template( $this->template_plain, array( 
  84. 'email_heading' => $this->get_heading(),  
  85. 'user_login' => $this->user_login,  
  86. 'user_activation' => $this->user_activation,  
  87. 'user_activation_url' => $this->user_activation_url,  
  88. 'user_pass' => $this->user_pass,  
  89. 'password_generated' => $this->password_generated,  
  90. 'blogname' => $this->get_blogname(),  
  91. 'sent_to_admin' => false,  
  92. 'plain_text' => true,  
  93. 'email' => $this 
  94. ) ); 
  95. return ob_get_clean();