---
title: "File attachments into the documents of a third party or a contact"
weight: 87
description: "Copy in one click the files received from a customer into the Documents tab of their card, without creating a ticket or a project."
source_hash: "1a8dfc21"
---

# File attachments into the documents of a third party or a contact

A customer sends you their Kbis, a signed order form, an insurance certificate. These files belong in their Dolibarr card, not only in your mailbox. This action files them there directly, without going through a ticket or a project.

## Before starting

- **The email must be linked to a third party.** The proposed destinations are those of the email: its third party, the secondary third parties attached to it, and its contact if it has one. An email without a third party offers nothing: [link it first](/capmail/action-lier-tiers).
- You need the **edit third parties** right to file into a third party, and the **edit contacts** right to file into a contact. Without this right, the filing bar does not appear.
- If you only see your own customers (no "view all third parties" right), only those you are the sales rep for are proposed.

## From Lead Mode

1. Open the email.
2. Under the message, in the **Attachments** block, **tick** the files to file. "Check all" selects them all at once.
3. Choose the destination in the list: the third party, a secondary third party or the contact.
4. Click **File**.

A notification indicates how many files were filed, with a **View documents** link that opens the Documents tab of the card.

## From the email card

Same principle in the attachments frame, on the right: a checkbox at the top left of each file, the destination and the **File** button under the list.

## What it produces

The checked files are **copied** into the **Documents** tab of the third party or contact card. The email keeps its own: it remains a faithful archive of what the customer sent.

They are also declared in the Dolibarr **DMS**: they appear in the DMS module and in its search, like a file sent from the card.

## Nothing is ever overwritten

A customer's Documents tab often contains older files. Capmail never replaces one of them:

- **same name, same content**: the file is already there, it is left as is. Filing the same email twice therefore does not create a duplicate;
- **same name, different content**: the new file is saved under a suffixed name (`contract-1.pdf`, `contract-2.pdf`...). The notification indicates the name used.

## Doing it automatically

An [automatic filter](/capmail/action-filtrer-courrier) can file all attachments of matching emails: actions **File attachments into the documents of the third party** and **... of the contact**. Example: each URSSAF certificate received goes directly into the supplier's card.

- Filing happens **after** linking to the third party and creating the third party, whatever the order in which you entered the actions: a filter that links then files works in one pass.
- A filter files **all** attachments, including images embedded in signatures (logos). Since an identical file is never saved twice, a logo is only added once per customer.
- An email without attachments is not an error: the filter simply has nothing to do.

## Filing is not attaching

To deposit files into a **quote**, an **order**, an **invoice**, a **project** or a **ticket**, use [Attach an email to an object](/capmail/action-rattacher-objet): the email then also appears in the linked objects of the document. Filing into a third party creates no link, only documents.

## See also

- [Link an email to an existing third party](/capmail/action-lier-tiers)
- [Attach an email to a quote, an order, an invoice or a project](/capmail/action-rattacher-objet)
- [Automatically filter incoming mail](/capmail/action-filtrer-courrier)
- [What do you want to do?](/capmail/actions)
