formcierge_email_attachments
Filter

Since v1.0.0

Add file attachments to a notification email before it is sent. Return an array of absolute file paths.

Parameters
$attachments array Array of absolute file paths.
$form_id int The form ID.
$entry_id int The entry ID.
Defined in
includes/Core/Mailer.php
add_filter( 'formcierge_email_attachments', function ( $attachments, $form_id, $entry_id ) {
    $pdf_path = my_generate_receipt_pdf( $entry_id );
    if ( $pdf_path ) {
        $attachments[] = $pdf_path;
    }
    return $attachments;
}, 10, 3 );