php Event Tickets&Plus:将媒体库中的文件附加到所有票证电子邮件。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php Event Tickets&Plus:将媒体库中的文件附加到所有票证电子邮件。相关的知识,希望对你有一定的参考价值。

<?php

/**
 * Event Tickets & Plus: Attach a file from Media Library to all ticket emails.
 *
 * Does not work for emails for declined RSVPs or for moved tickets, but it
 * could if you want it to; just add those additional hooks.
 *
 * @link https://gist.github.com/cliffordp/fc7f1687b26c7292672ead9f26c4d568
 * @link https://theeventscalendar.com/support/forums/topic/pdf-attachment-file-to-ticket-email/
 */
function cliff_attach_file_to_all_tickets( array $attachments ) {
	// !!! CHANGE THIS !!!
	$attachment_id = 6391;

	// We do it this way to make sure we get the path, not the link.
	$file = get_attached_file( $attachment_id );

	if ( file_exists( $file ) ) {
		$attachments[] = $file;
	}

	return $attachments;
}

add_action( 'tribe_rsvp_email_attachments', 'cliff_attach_file_to_all_tickets', 50 );
add_action( 'tribe_tpp_email_attachments', 'cliff_attach_file_to_all_tickets', 50 );
add_action( 'tribe_tickets_plus_woo_email_attachments', 'cliff_attach_file_to_all_tickets', 50 );
add_action( 'edd_ticket_receipt_attachments', 'cliff_attach_file_to_all_tickets', 50 );

以上是关于php Event Tickets&Plus:将媒体库中的文件附加到所有票证电子邮件。的主要内容,如果未能解决你的问题,请参考以下文章

php Event Tickets Plus:在WooCommerce订单电子邮件的末尾添加额外的换行符。

php Event Tickets Plus:在WooCommerce订单电子邮件的末尾添加额外的换行符。

php Event Tickets Plus - 隐藏所有活动的参加者列表。屏幕截图:https://cl.ly/0H0A2I2d1k2B

php Event Tickets Plus - 隐藏所有活动的参加者列表。屏幕截图:https://cl.ly/0H0A2I2d1k2B

php Event Tickets Plus v4.6 +:保存后将所有WooCommerce门票分配到特定产品类别(创建或更新,不会影响旧刻度)

php Event Tickets Plus v4.6 +:保存后将所有WooCommerce门票分配到特定产品类别(创建或更新,不会影响旧刻度)