Skip to content

Instantly share code, notes, and snippets.

@alex-authlab
Last active March 23, 2021 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alex-authlab/c64aff525c2c6f9733a9a17f6b47a0e5 to your computer and use it in GitHub Desktop.
Save alex-authlab/c64aff525c2c6f9733a9a17f6b47a0e5 to your computer and use it in GitHub Desktop.
WP Fluent Forms Email Attachment Filter
add_filter('fluentform_filter_email_attachments', function($emailAttachments, $notification,$form, $entry){
$target_form_id = 29;
if($form->id != $target_form_id){
return;
}
$media_id = 144;
$emailAttachments[] = get_attached_file($media_id);
//or pass the exact file location like this
//$emailAttachments[] = '/doc/wp/wp-content/uploads/FLUENT_PDF_TEMPLATES/pdfCache/%c3%a4-%c3%bc%c3%9f-etc_531_171.pdf';
return $emailAttachments;
}, 10, 5);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment