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.
POST, form-encoded, with two fields:
data (the email, as JSON with the field names shown below) and
fpx (the transaction report, snake_case JSON).Attachments, if present,
replaces the attachment list; each entry is {"Filename": "...", "Data": "<base64>"}.Template unless Tulus has told you the name: it must match a
template that already exists on the Tulus side, or the email renders empty.https:// URL on a public hostname
(no IP addresses or internal hosts), at most 512 characters. Tulus sets it per agency.
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.
Fields in yellow are what your endpoint changed.
| Field | Default | After your endpoint |
|---|
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
was re-sent as a plain form post; the raw reply is shown below. For a full check, run
snapnpay-server2 testemail --customize-url <url> or add the CORS header while testing.
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'