Message
Message to be shown to the customer.
| Field | Type | Required | Description |
|---|---|---|---|
type |
string |
yes | one of: error, warning, info |
code |
string |
Message code, mapped by the extension. It can be used to react in a specific way for certain messages and/or to enable message translations. | |
message |
string |
yes | Message to display to the customer. This can also be a translation string, defined in a locale file in the theme or any custom extension. |
messageParams |
MessageParams | The message params for the translation string. Translation params are just key/value pairs defined in the translation string defined in the ‘locales/message property. It defaults to an empty object if the property is missing or null. The translation string syntax is described here: https://github.com/yahoo/intl-messageformat#message-syntax |
|
translated |
boolean |
Indicates if the ‘message’ property contains a translated string (true) or a translation string (false or undefined). Defaults to true if the property is missing or null. |
Example
Section titled “Example”{ "type": "error", "code": "EUNKNOWN", "message": "Some error occurred.", "messageParams": { "my-custom-key": "my-custom-translation-param", "my-custom-value": "42 (fourty two)" }, "translated": false}
