Modify an existing order mail template
Content
Resource URL
https://apps.ticketmatic.com/api/1/{accountname}/settings/communicationanddesign/ordermails/{id}
Example
Request
1use Ticketmatic\Endpoints\Settings\Communicationanddesign\Ordermails;
2
3$result = Ordermails::update($client, $id, array(
4 "typeid" => 3101,
5 "name" => "Order confirmation",
6 "body" => "<!-- Block of HTML -->",
7 "subject" => "Your reservation",
8 "translations" => array(
9 "nl" => "...",
10 ),
11));
Response
1object(\Ticketmatic\Model\OrderMailTemplate) (9) {
2 ["id"]=>
3 int(0)
4 ["typeid"]=>
5 int(0)
6 ["name"]=>
7 string(18) "Order confirmation"
8 ["body"]=>
9 string(22) "<!-- Block of HTML -->"
10 ["subject"]=>
11 string(16) "Your reservation"
12 ["translations"]=>
13 array(1) {
14 ["nl"]=>
15 string(3) "..."
16 }
17 ["isarchived"]=>
18 bool(false)
19 ["createdts"]=>
20 object(\DateTime) (3) {
21 ["date"]=>
22 string(26) "2014-09-26 15:24:36.000000"
23 ["timezone_type"]=>
24 int(3)
25 ["timezone"]=>
26 string(3) "UTC"
27 }
28 ["lastupdatets"]=>
29 object(\DateTime) (3) {
30 ["date"]=>
31 string(26) "2014-09-26 15:24:36.000000"
32 ["timezone_type"]=>
33 int(3)
34 ["timezone"]=>
35 string(3) "UTC"
36 }
37}
Request
1import (
2 "github.com/ticketmatic/tm-go/ticketmatic"
3 "github.com/ticketmatic/tm-go/ticketmatic/settings/communicationanddesign/ordermails"
4)
5
6result, err := ordermails.Update(client, id, &ticketmatic.OrderMailTemplate{
7 Typeid: 3101,
8 Name: "Order confirmation",
9 Body: "<!-- Block of HTML -->",
10 Subject: "Your reservation",
11 Translations: map[string]string{
12 "nl": "...",
13 },
14})
Response
1result := &ticketmatic.OrderMailTemplate{
2 Id: 123,
3 Typeid: 3101,
4 Name: "Order confirmation",
5 Body: "<!-- Block of HTML -->",
6 Subject: "Your reservation",
7 Translations: map[string]string{
8 "nl": "...",
9 },
10 Isarchived: false,
11 Createdts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
12 Lastupdatets: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
13}
Request
1PUT /api/1/{accountname}/settings/communicationanddesign/ordermails/{id} HTTP/1.1
2Content-Type: application/json
3
4{
5 "typeid": 3101,
6 "name": "Order confirmation",
7 "body": "<!-- Block of HTML -->",
8 "subject": "Your reservation",
9 "translations": {
10 "nl": "..."
11 }
12}
Response
1HTTP/1.1 200 OK
2Content-Type: application/json
3
4{
5 "id": 123,
6 "typeid": 3101,
7 "name": "Order confirmation",
8 "body": "<!-- Block of HTML -->",
9 "subject": "Your reservation",
10 "translations": {
11 "nl": "..."
12 },
13 "isarchived": false,
14 "createdts": "2014-09-26 15:24:36",
15 "lastupdatets": "2014-09-26 15:24:36"
16}
Request body fields
Field | Description |
---|---|
typeid int (required) | The type of this order mail template, defines where this template is used. The available values for this field can be found on the order mail template overview page. Example value:3101 |
name string (required) | Name of the order mail template Example value:"Order confirmation" |
body string (required) | Message body Example value:"<!-- Block of HTML -->" |
subject string (required) | Subject line for the order mail template Example value:"Your reservation" |
translations map<string, string> (required) | A map of language codes to gettext .po files. More info can be found on the order mail template overview page. Example value:{ "nl": "..." } |
Type reference: OrderMailTemplate
Result fields
Field | Description |
---|---|
id int | Unique ID Example value:123 |
typeid int | The type of this order mail template, defines where this template is used. The available values for this field can be found on the order mail template overview page. Example value:3101 |
name string | Name of the order mail template Example value:"Order confirmation" |
body string | Message body Example value:"<!-- Block of HTML -->" |
subject string | Subject line for the order mail template Example value:"Your reservation" |
translations map<string, string> | A map of language codes to gettext .po files. More info can be found on the order mail template overview page. Example value:{ "nl": "..." } |
isarchived bool | Whether or not this item is archived |
createdts timestamp | Created timestamp Example value:"2014-09-26 15:24:36" |
lastupdatets timestamp | Last updated timestamp Example value:"2014-09-26 15:24:36" |
Type reference: OrderMailTemplate