Automattic\WooCommerce\Admin
ReportExporter::email_report_download_link() public WC 1.0
Process a report export email action.
{} Это метод класса: ReportExporter{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
$result = ReportExporter::email_report_download_link( $user_id, $export_id, $report_type );
- $user_id(число) (обязательный)
- 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() ReportExporter::email report download link WC 5.2.2
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 );
}
}