Email Customization Playground
Email Customization Endpoint
Tool help explains request and retry behavior.
For agencies set to the external email template, Tulus calls your endpoint just before
sending each payment receipt email. Your endpoint can change the email's text, subject and sender,
and attach files such as a PDF receipt.
- Request:
POST, form-encoded, with two fields:data(the email, as JSON with the field names shown below) andfpx(the transaction report, snake_case JSON). - Response: a JSON object with only the fields you want to change.
Fields you leave out keep their default values.
Attachments, if present, replaces the attachment list; each entry is{"Filename": "...", "Data": "<base64>"}. - Failure is safe: if your endpoint is unreachable, takes over 30 seconds, returns a non-2xx status, or returns invalid JSON (including a wrong type for any field), the payer gets the default email unchanged.
- Do not set
Templateunless Tulus has told you the name: it must match a template that already exists on the Tulus side, or the email renders empty. - Endpoint requirements: an
https://URL on a public hostname (no IP addresses or internal hosts), at most 512 characters. Tulus sets it per agency. - Privacy: requests contain the payer's name, email and payment details. Do not log or store them longer than you need.
A working sample lives at /customemail/endpoint.php
(add ?attach=1 for a generated PDF). When your endpoint passes the test below, ask Tulus
support to set it as your agency's email customization URL.
Test an endpoint
Result
Fields in yellow are what your endpoint changed.
| Field | Default | After your endpoint |
|---|
Raw response
Raw response
The browser could not read your endpoint's reply directly (usually because it does not send an
Access-Control-Allow-Origin header, which Tulus itself does not need). The request
may already have reached the endpoint. To inspect a raw reply, explicitly send the same request again below. For a full check, run
snapnpay-server2 testemail --customize-url <url> or add the CORS header while testing.
Test from the command line
curl -s https://developers.tulus.my/customemail/endpoint.php \
--data-urlencode 'data={"Subject":"Payment Notification"}' \
--data-urlencode 'fpx={"agency":"SNAPNPAY","fpx_debit_auth_code":"00"}'
Tulus staff can run the real Go code path against any endpoint, without a database:
snapnpay-server2 testemail --customize-url 'https://developers.tulus.my/customemail/endpoint.php?attach=1'