Guides
Webhooks and networking
Reach servers on your machine from inside the container, for webhooks and attachment URLs.
localhost inside Docker
Inside the container, localhost is the container itself, not your machine. When Pretend needs to call a server running on your machine, use host.docker.internal instead.
That name only resolves if the container was started with it:
--add-host host.docker.internal:host-gatewayextra_hosts:
- "host.docker.internal:host-gateway"Both the Quickstart command and the Compose file already include it.
Webhooks
Create a webhook in the dashboard under Webhooks, or with the API. If your app listens on port 4000 on your machine, the endpoint is:
http://host.docker.internal:4000/api/webhooks/resendPretend signs each delivery with the webhook's signing secret, so your existing verification code keeps working. You can rotate the secret and disable the webhook from its page.
Attachments from a URL
An attachment with a path is fetched by Pretend while it handles the send, so the same rule applies: point path at host.docker.internal, not localhost.
{
"attachments": [
{ "filename": "invoice.pdf", "path": "http://host.docker.internal:4000/invoice.pdf" }
]
}Attachments sent as base64 content need no network access. Each email allows up to 40 MB of attachments. They are stored under DATA_DIR/attachments/ and served through signed download_urls that last one hour.