Automattic\WooCommerce\Internal\Admin\Notes
EmailNotification::trigger()
Trigger the sending of this email.
Method of the class: EmailNotification{}
No Hooks.
Return
null
. Nothing (null).
Usage
$EmailNotification = new EmailNotification(); $EmailNotification->trigger( $user_email, $user_id, $user_name );
- $user_email(string) (required)
- Email to send the note.
- $user_id(int) (required)
- User id to to track the note.
- $user_name(string) (required)
- User's name.
EmailNotification::trigger() EmailNotification::trigger code WC 9.6.1
public function trigger( $user_email, $user_id, $user_name ) { $this->recipient = $user_email; $this->opened_tracking_url = sprintf( '%1$s/wp-json/wc-analytics/admin/notes/tracker/%2$d/user/%3$d', site_url(), $this->note->get_id(), $user_id ); $this->trigger_note_action_url = sprintf( '%1$s&external_redirect=1¬e=%2$d&user=%3$d&action=', wc_admin_url(), $this->note->get_id(), $user_id ); if ( $user_name ) { /* translators: %s = merchant name */ $this->placeholders['{greetings}'] = sprintf( __( 'Hi %s,', 'woocommerce' ), $user_name ); } $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); Notes::record_tracks_event_with_user( $user_id, 'email_note_sent', array( 'note_name' => $this->note->get_name() ) ); }