Automattic\WooCommerce\Admin
ReportCSVEmail::trigger
Trigger the sending of this email.
Метод класса: ReportCSVEmail{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$ReportCSVEmail = new ReportCSVEmail(); $ReportCSVEmail->trigger( $user_id, $report_type, $download_url );
- $user_id(int) (обязательный)
- User ID to email.
- $report_type(строка) (обязательный)
- The type of report export being emailed.
- $download_url(строка) (обязательный)
- The URL for downloading the report.
Код ReportCSVEmail::trigger() ReportCSVEmail::trigger WC 10.5.2
public function trigger( $user_id, $report_type, $download_url ) {
$user = new \WP_User( $user_id );
$this->recipient = $user->user_email;
$this->download_url = $download_url;
if ( isset( $this->report_labels[ $report_type ] ) ) {
$this->report_type = $this->report_labels[ $report_type ];
$this->placeholders['{report_name}'] = $this->report_type;
}
$this->send(
$this->get_recipient(),
$this->get_subject(),
$this->get_content(),
$this->get_headers(),
$this->get_attachments()
);
}