> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usefactor.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Background Job Example

> Async processing failure modes

## The PR

**Title**: Add email notification for invoice downloads

**Summary**:
When a customer downloads an invoice, we should send them a notification email for their records. This PR adds a background job that sends the email asynchronously.

**Changes**:

* New `EmailInvoiceJob` class that sends email
* Job is enqueued when invoice is downloaded
* Job has 3 retries on failure

***

## Factor Analysis

### Verdict

```
REVIEW_REQUIRED
```

Async jobs introduce failure modes that need careful handling.

***

... (rest of file unchanged)
