Skip to content

Commit ff9de20

Browse files
Update click-and-open-tracking.md (#86)
* Update click-and-open-tracking.md Clarify configuration of click tracking with default Caddy configuration * Update content/3.features/click-and-open-tracking.md Co-authored-by: Will Power <1619102+willpower232@users.noreply.github.com> * Apply CR proposals * Simplify instructions --------- Co-authored-by: Will Power <1619102+willpower232@users.noreply.github.com>
1 parent 6a433a7 commit ff9de20

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

content/3.features/click-and-open-tracking.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,39 @@ Once enabled, Postal will automatically scan your outgoing messages and replace
1515

1616
## Configuring your web server
1717

18-
To avoid messages being marked as spam, it's important that the subdomain that Postal uses in the re-written URLs is on the same domain as that sending the message. This means if you are sending mail from `example.com`, you'll need to setup `click.example.com` (or whatever you choose) to point to your Postal server.
18+
To avoid messages being marked as spam, it's important that the subdomain that Postal uses in the re-written URLs is on the same domain as that sending the message. This means if you are sending mail from `yourdomain.com`, you'll need to setup `click.yourdomain.com` (or whatever you choose) to point to your Postal server.
19+
20+
There are two ways how to achive that traffic to `click.yourdomain.com` will reach Postal:
21+
1. Adding CNAME record for `click.yourdomain.com` to previously configured `track.postal.example.com` followed by Caddy additional configuration.
22+
2. Configuring custom proxy for `click.yourdomain.com` on your webserver.
23+
24+
### Additional Caddy configuration
25+
26+
If you used Caddy as proxy for overall Postal traffic it easy to add additional proxy its config `/opt/postal/config/Caddyfile`:
27+
28+
```
29+
# ... previous content
30+
31+
click.yourdomain.com {
32+
reverse_proxy 127.0.0.1:5000 {
33+
header_up X-Postal-Track-Host "1"
34+
}
35+
}
36+
```
37+
38+
After saving this new configuration restart Caddy, for example if you're using docker, you may be able to `docker restart postal-caddy`.
39+
40+
After this you should see `Hello.` on `click.yourdomain.com` and SSL should work out of the box.
41+
42+
### Custom proxy on webserver
1943

2044
You'll need to add an appropriate virtual host on your web server that proxies traffic from that domain to the Postal web server. The web server must add the `X-Postal-Track-Host: 1` header so the Postal web server knows to treat requests as tracking requests.
2145

2246
Once you have configured this, you should be able to visit your chosen domain in a browser and see `Hello.` printed back to you. If you don't see this, review your configuration until you do. If you still don't see this and you enable the tracking, your messages will be sent with broken links and images.
2347

24-
If you're happy things are working, you can enable tracking as follows:
48+
### Setting up tracking domain
2549

50+
If you're happy things are working, you can enable tracking as follows:
2651
1. Find the web server you wish to enable tracking on in the Postal web interface
2752
2. Go to the **Domains** item
2853
3. Select **Tracking Domains**

0 commit comments

Comments
 (0)