---
title: fluentform/filter_email_attachments
description: "### Description This filter gives the option to add your own attachment with the email. It is called before sending an email notification. ### Usage Here is an example: ```php add_filter('fluentform/filter_email_attachments', function($emailAttachments, $notification,$form, $submittedData){ $target_form_id = 29; if($form->id != $target_form_id){…"
url: "https://fluentforms.com/docs/fluentform_filter_email_attachments/"
updated: "2023-07-21"
category: Filter Hooks
---

# fluentform/filter_email_attachments

### Description

This filter gives the option to add your own attachment with the email. It is called before sending an email notification.

### Usage

Here is an example:

```php
add_filter('fluentform/filter_email_attachments', function($emailAttachments, $notification,$form, $submittedData){

    $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/%c3%a4-%c3%bc%c3%9f-etc_531_171.pdf';

    return $emailAttachments;

}, 10, 4);
```

### Parameters

- **$emailAttachments** (Array) Attachments

- **$notification** (Array) Notification settings data

- **$submittedData** (Array) Submitted form data

- **$form** (Object) The [$form Object](https://fluentforms.com/docs/form-object/)

## Placement

This code should be placed in the [functions.php](http://codex.wordpress.org/Theme_Development#Functions_File) file of your active theme. You can also use snippet plugins to add functions if you do not want to modify the function.php file.

## Source Code

This filter is located in FluentForm\app\Services\FormBuilder\Notifications\EmailNotifications -> notify($notification, $submittedData, $form, $entryId = false)
