Fany_VanDaal icon

Přidání přílohy do emailu

Fany_VanDaal | PRO | 05/23/19 08:40:26 AM UTC | 0 ⭐ | 1616 👁️ | Never ⏰ | []
PHP |

630 B

|

None

|

0 👍

/

0 👎

// přidání dokumentů do emailu 
add_filter( 'woocommerce_email_attachments', 'attach_complaints_conditions_pdf_to_email', 10, 3);
 
function attach_complaints_conditions_pdf_to_email ( $attachments, $status , $order ) {
 
$allowed_statuses = array( 'new_order', 'customer_invoice', 'customer_processing_order', 'customer_completed_order' );
 
if( isset( $status ) && in_array ( $status, $allowed_statuses ) ) {
$dokument1 = get_template_directory() . '/oznameni-o-odstoupeni-od-smlouvy.pdf';
$dokument2 = get_template_directory() . '/obchodni-podminky.pdf';
$attachments = array($dokument1, $dokument2);
}
return $attachments;
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎