By default, the PDF generated by the Gravity Flow PDF Generator Extension is deleted immediately after sending by email - this helps to ensure that unauthorized users don't see fields values later on in the workflow. The gravityflowpdf_delete_post_send filter can be used to prevent the PDF file from being deleted when it is sent by email. 


$delete_pdf boolean (default: true)

Whether to delete the PDF after sending by email.

$form array

The form array

$entry array

The entry array

$step Gravity_Flow_Step_PDF

The PDF step.


Example 1

Retain the PDF on the server after sending by email only for form ID 1. 

add_filter( 'gravityflowpdf_delete_post_send', function( $delete_pdf, $form, $entry, $step ) {
    if ( $form['id'] == 1 ) {
        $delete_pdf = false;

    return $delete_pdf;
} );

Example 2

Always retain the PDF file on the server after sending by email regardless of the form or step.

add_filter( 'gravityflowpdf_delete_post_send', '__return_false' );


This filter was added in version 1.3.