id = 'ppl_afw_affiliate_approved'; $this->title = __( 'Affiliate approved', 'affireo-affiliates-for-woocommerce' ); $this->description = __( 'Sent to an applicant when they are approved as an affiliate.', 'affireo-affiliates-for-woocommerce' ); $this->customer_email = true; $this->heading = __( 'Welcome to our affiliate program', 'affireo-affiliates-for-woocommerce' ); $this->subject = __( 'Your affiliate application was approved', 'affireo-affiliates-for-woocommerce' ); add_action( 'ppl_afw_affiliate_approved', array( $this, 'trigger' ), 20, 1 ); parent::__construct(); } /** * Triggers the email. * * @since 1.0.0 * @param int $affiliate_id Affiliate id. */ public function trigger( $affiliate_id ) { $this->setup_locale(); $this->affiliate = $this->affiliates()->find( $affiliate_id ); $user = $this->affiliate ? get_userdata( (int) $this->affiliate->user_id ) : null; if ( $user ) { $this->recipient = $user->user_email; $this->dispatch(); } $this->restore_locale(); } /** * Body content. * * @since 1.0.0 * @return string */ protected function get_body() { return '

' . esc_html__( 'Great news! Your affiliate account is now active. Log in to your dashboard to grab your referral link and start earning.', 'affireo-affiliates-for-woocommerce' ) . '

' . $this->dashboard_link(); } }