mail-settings
Stable. Describes behaviour that is built and covered by tests in this repository.
GET /v1/mail-settings #
Which kinds of e-mail Payrudder sends for the tenant (all on until switched off, except customer_notices, which is off until switched on)
Categories: invoice_issued, payment_receipts, payment_failed, usage_alerts, system, customer_notices. customer_notices is the notice to a customer that the seller blocked them or lifted the block (never with the seller's reason); it is off until the tenant switches it on, the other categories are on. A mail of a category that is off is dropped by the notifier
(counted in notifier_mail_dropped_total), not retried. Whether a provider sends its own receipts is a separate rule (Paddle does, so Payrudder sends none for its payments).
Responses
| Status | Meaning | Body |
|---|---|---|
200 | OK | MailSettings |
Example response
{
"categories": [
{
"category": "invoice_issued",
"enabled": false
}
]
}curl
curl -X GET https://YOUR-API-ADDRESS/v1/mail-settings \
-H "Authorization: Bearer $PAYRUDDER_API_KEY"PUT /v1/mail-settings #
Switch the listed categories on or off; the others keep their setting
An unknown category is rejected with the error key plans.mail.unknown_category. A category listed twice takes its last value.
Request body
| Field | Type | Description |
|---|---|---|
categories | array of object |
Example
{}Responses
| Status | Meaning | Body |
|---|---|---|
200 | Every category with its new state | MailSettings |
400 | Error envelope | Error |
Example response
{
"categories": [
{
"category": "invoice_issued",
"enabled": false
}
]
}curl
curl -X PUT https://YOUR-API-ADDRESS/v1/mail-settings \
-H "Authorization: Bearer $PAYRUDDER_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'Models
Error
| Field | Type | Description |
|---|---|---|
error required | object |
MailSettings
| Field | Type | Description |
|---|---|---|
categories required | array of object |
MailSettingsInput
| Field | Type | Description |
|---|---|---|
categories | array of object |