To make an online store legally clean, the order email should also contain the terms and conditions and the revocation. These texts can be placed in the footer of the email or visually cleaner as an attached pdf file. The following script in the functions.php integrates a corresponding file:
add_filter( 'woocommerce_email_attachments', 'wphelp_email_files_woo', 10, 4 ); function wphelp_email_files_woo( $attachments, $email_id, $order, $email ) { $email_ids = array( 'new_order', 'customer_processing_order' ); if ( in_array ( $email_id, $email_ids ) ) { $upload_dir = wp_upload_dir(); $attachments[] = $upload_dir['basedir'] . "/datei.pdf"; } return $attachments; }