{ "type":"object", "title": "email", "description":"An email in SK must always be related to an object.", "properties": { "id": { "description": "uuid of the email", "identity":true, "readonly":true, "type":"string" }, "bcc_addr": { "description": "BCC addresses, comma separated. Max 5, format: a@b.de,'George'", "type":"string" }, "cc_addr": { "description": "CC addresses, comma separated. Max 5, format: a@b.de,'George'", "type":"string" }, "from_addr": { "description": "From address", "required":true, "type":"string" }, "to_addr": { "description": "TO addresses, comma separated. Max 5, format: a@b.de,'George'", "required":true, "type":"string" }, "subject": { "description": "The email subject.", "required":true, "type":"string" }, "body": { "description": "The email text.", "required":true, "type":"string" }, "attachments":{ "description": "The emails attachments.", "readonly":true, "type":"array", "properties":{"$ref":"./attachment.json#properties"} }, "related_object_type": { "description": "Object type of the emails parent. Is the camelcased base class name: Document for invoice, credit_note,.., Contact for client", "required":true, "type":"string" }, "related_object_id": { "description": "uuid of the emails parent object.", "required":true, "type":"string" }, "in_progress": { "description": "Is set after an email has been scheduled for sending until it has been sent.", "readonly":true, "type":"boolean" }, "delivered_at": { "description": "Date the email was delivered by SK. If set, the message cannot be edited anymore.", "format":"date-time", "readonly":true, "type":"string" }, "created_at": { "description": "Date the object was created in SK. Never changes afterwards", "format":"date-time", "readonly":true, "type":"string" }, "updated_at": { "description": "Date the object was edited in SK.", "format":"date-time", "readonly":true, "type":"string" } }, "links":[ { "rel": "self", "href": "emails/{id}" }, { "rel": "instances", "href": "emails", "properties" : { "page":{ "title" : "Page", "description": "In paginated results set the page to look for", "type":"number" }, "filter[q]":{ "title" : "Search", "description": "Search in text", "type":"string" }, "filter[from]":{ "title" : "From date", "description": "All objects with a date after the date" }, "filter[to]":{ "title" : "To date", "description": "All objects with date before the date" }, "sort_by":{ "title" : "Sort by", "description": "Sort the results by the given field => number", "enum":['created_at', 'updated_at'], "type": 'string' }, "sort":{ "title" : "Sort", "enum":["ASC","DESC"], "description": "Sort the results in ASC or DESC" } } }, { "rel": "attachments", "href": "emails/{id}/attachments" }, { "rel": "destroy", "href": "emails/{id}", "method": "DELETE" }, { "rel": "update", "href": "emails/{id}", "method": "PUT" }, { "rel": "create", "href": "emails", "method": "POST", "properties" : { "template_id":{ "title" : "Template", "description": "UUID of an email template to use. If present, subject, body and attachments of the template are used for the current email.", "type":"string" }, "send":{ "title" : "Send email", "description": "If present(any val) email is scheduled for sending." }, "archived_pdf":{ "title" : "Attach archived pdf", "description": "Adds the archived pdf from the related resource(if it has one)." } } } ] }