Automated email rules¶
Resource description¶
Automated email rules that specify emails that the system will send automatically at a specific point in time, e.g. the day of the event.
Field |
Type |
Description |
---|---|---|
id |
integer |
Internal ID of the rule |
enabled |
boolean |
If |
subject |
multi-lingual string |
The subject of the email |
template |
multi-lingual string |
The body of the email |
all_products |
boolean |
If |
limit_products |
list of integers |
List of product IDs, if |
include_pending |
boolean |
If |
date_is_absolute |
boolean |
If |
send_date |
datetime |
If |
send_offset_days |
integer |
If |
send_offset_time |
time |
If |
offset_to_event_end |
boolean |
If |
offset_is_after |
boolean |
If |
send_to |
string |
Can be |
Endpoints¶
- GET /api/v1/organizers/(organizer)/events/(event)/sendmail_rules/¶
Returns a list of all rules configured for an event.
Example request:
GET /api/v1/organizers/bigevents/events/sampleconf/sendmail_rules/ HTTP/1.1 Host: pretix.eu Accept: application/json, text/javascript
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: application/json { "count": 1, "next": null, "previous": null, "results": [ { "id": 1, "enabled": true, "subject": {"en": "See you tomorrow!"}, "template": {"en": "Don't forget your tickets, download them at {url}"}, "all_products": true, "limit_products": [], "include_pending": false, "send_date": null, "send_offset_days": 1, "send_offset_time": "18:00", "date_is_absolute": false, "offset_to_event_end": false, "offset_is_after": false, "send_to": "orders" } ] }
- Query Parameters:
page – The page number in case of a multi-page result set, default is 1
- Parameters:
organizer – The
slug
field of a valid organizerevent – The
slug
field of the event to fetch
- Status Codes:
200 OK – no error
401 Unauthorized – Authentication failure
403 Forbidden – The requested organizer does not exist or you have no permission to view it.
- GET /api/v1/organizers/(organizer)/events/(event)/sendmail_rules/(id)/¶
Returns information on one rule, identified by its ID.
Example request:
GET /api/v1/organizers/bigevents/events/sampleconf/sendmail_rules/1/ HTTP/1.1 Host: pretix.eu Accept: application/json, text/javascript
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: application/json { "id": 1, "enabled": true, "subject": {"en": "See you tomorrow!"}, "template": {"en": "Don't forget your tickets, download them at {url}"}, "all_products": true, "limit_products": [], "include_pending": false, "send_date": null, "send_offset_days": 1, "send_offset_time": "18:00", "date_is_absolute": false, "offset_to_event_end": false, "offset_is_after": false, "send_to": "orders" }
- Parameters:
organizer – The
slug
field of the organizer to fetchevent – The
slug
field of the event to fetchid – The
id
field of the rule to fetch
- Status Codes:
200 OK – no error
401 Unauthorized – Authentication failure
403 Forbidden – The requested organizer/event/rule does not exist or you have no permission to view it.
- POST /api/v1/organizers/(organizer)/events/(event)/sendmail_rules/¶
Create a new rule.
Example request:
POST /api/v1/organizers/bigevents/events/sampleconf/sendmail_rules/ HTTP/1.1 Host: pretix.eu Accept: application/json, text/javascript Content-Type: application/json Content-Length: 166 { "enabled": true, "subject": {"en": "See you tomorrow!"}, "template": {"en": "Don't forget your tickets, download them at {url}"}, "all_products": true, "limit_products": [], "include_pending": false, "send_date": null, "send_offset_days": 1, "send_offset_time": "18:00", "date_is_absolute": false, "offset_to_event_end": false, "offset_is_after": false, "send_to": "orders" }
Example response:
HTTP/1.1 201 Created Vary: Accept Content-Type: application/json { "id": 1, "enabled": true, "subject": {"en": "See you tomorrow!"}, "template": {"en": "Don't forget your tickets, download them at {url}"}, "all_products": true, "limit_products": [], "include_pending": false, "send_date": null, "send_offset_days": 1, "send_offset_time": "18:00", "date_is_absolute": false, "offset_to_event_end": false, "offset_is_after": false, "send_to": "orders" }
- Parameters:
organizer – The
slug
field of the organizer to create a rule forevent – The
slug
field of the event to create a rule for
- Status Codes:
201 Created – no error
400 Bad Request – The rule could not be created due to invalid submitted data.
401 Unauthorized – Authentication failure
403 Forbidden – The requested organizer/event does not exist or you have no permission to create rules.
- PATCH /api/v1/organizers/(organizer)/events/(event)/sendmail_rules/(id)/¶
Update a rule. You can also use
PUT
instead ofPATCH
. WithPUT
, you have to provide all fields of the resource, other fields will be reset to default. WithPATCH
, you only need to provide the fields that you want to change.Example request:
PATCH /api/v1/organizers/bigevents/events/sampleconf/sendmail_rules/1/ HTTP/1.1 Host: pretix.eu Accept: application/json, text/javascript Content-Type: application/json Content-Length: 34 { "enabled": false, }
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: text/javascript { "id": 1, "enabled": false, "subject": {"en": "See you tomorrow!"}, "template": {"en": "Don't forget your tickets, download them at {url}"}, "all_products": true, "limit_products": [], "include_pending": false, "send_date": null, "send_offset_days": 1, "send_offset_time": "18:00", "date_is_absolute": false, "offset_to_event_end": false, "offset_is_after": false, "send_to": "orders" }
- Parameters:
organizer – The
slug
field of the organizer to modifyevent – The
slug
field of the event to modifyid – The
id
field of the rule to modify
- Status Codes:
200 OK – no error
400 Bad Request – The rule could not be modified due to invalid submitted data.
401 Unauthorized – Authentication failure
403 Forbidden – The requested organizer/event/rule does not exist or you have no permission to change it.
- DELETE /api/v1/organizers/(organizer)/events/(event)/sendmail_rules/(id)/¶
Delete a rule.
Example request:
DELETE /api/v1/organizers/bigevents/events/sampleconf/sendmail_rules/1/ HTTP/1.1 Host: pretix.eu Accept: application/json, text/javascript
Example response:
HTTP/1.1 204 No Content Vary: Accept
- Parameters:
organizer – The
slug
field of the organizer to modifyevent – The
slug
field of the event to modifyid – The
id
field of the rule to delete
- Status Codes:
204 No Content – no error
401 Unauthorized – Authentication failure
403 Forbidden – The requested organizer/event/rule does not exist or you have no permission to change it or this rule cannot be deleted since it is currently in use.