Automattic\WooCommerce\Admin

ReportExporter::email_report_download_link()public staticWC 1.0

Process a report export email action.

Метод класса: ReportExporter{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$result = ReportExporter::email_report_download_link( $user_id, $export_id, $report_type );
$user_id(int) (обязательный)
User ID that requested the email.
$export_id(строка) (обязательный)
Unique ID for report (timestamp expected).
$report_type(строка) (обязательный)
Report type. E.g. 'customers'.

Код ReportExporter::email_report_download_link() WC 8.7.0

public static function email_report_download_link( $user_id, $export_id, $report_type ) {
	$percent_complete = self::get_export_percentage_complete( $report_type, $export_id );

	if ( 100 === $percent_complete ) {
		$query_args   = array(
			'action'   => self::DOWNLOAD_EXPORT_ACTION,
			'filename' => "wc-{$report_type}-report-export-{$export_id}",
		);
		$download_url = add_query_arg( $query_args, admin_url() );

		\WC_Emails::instance();
		$email = new ReportCSVEmail();
		$email->trigger( $user_id, $report_type, $download_url );
	}
}