Both sides previous revisionPrevious revision | Next revisionBoth sides next revision |
protogrid:api_endpoints [2021-12-02 15:39] – [/api/v2/apps/<app_name>/views/<view_name>] dru | protogrid:api_endpoints [2021-12-09 00:34] – [/api/v2/apps/<app_name>/mailsend] dru |
---|
url: "https://example.protogrid.com/api/v2/apps/example/mailsend", | url: "https://example.protogrid.com/api/v2/apps/example/mailsend", |
data: JSON.stringify({ | data: JSON.stringify({ |
"to": ["Tester 1 <test1@ategra.ch>", "Tester 2 <test2@ategra.ch>"], | "to": ["Tester 1️⃣ <test1@ategra.ch>", "Tester 2️⃣ <test2@ategra.ch>"], |
"cc": ["Tester 3 <test3@ategra.ch>", "Tester 4 <test4@ategra.ch>"], | "cc": ["Tester 3️⃣ <test3@ategra.ch>", "Tester 4️⃣ <test4@ategra.ch>"], |
"bcc": ["Tester 5 <test5@ategra.ch>", "Tester 6 <test6@ategra.ch>"], | "bcc": ["Tester 5️⃣ <test5@ategra.ch>", "Tester 6️⃣ <test6@ategra.ch>"], |
"reply_to": ["Tester 7 <test7@ategra.ch>", "Tester 8 <test8@ategra.ch>"], | "reply_to": ["Tester 7️⃣ <test7@ategra.ch>", "Tester 8️⃣ <test8@ategra.ch>"], |
"from": "Tester 0 <test0@ategra.ch>", | "from": "Tester 0️⃣ <test0@ategra.ch>", |
"subject": "Test Email", | "subject": "Test Email with Emojis 👍", |
"body_text_plain": "This is a test message in plain text.", | "body_text_plain": "This is a test message in plain text 😎.", |
"body_text_html": "This is a <b>test</b> message.<br><br>Please check if the message is displayed correctly using several different mail clients or tools like Mailtrap (<a href='https://mailtrap.io'>link</a>).<br><br><img src='cid:logo.png'></img>", | "body_text_html": "This is a <b>test</b> message 🤖.<br><br>Please check if the message is displayed correctly using several different mail clients or tools like Mailtrap (<a href='https://mailtrap.io'>link</a>).<br><br><img src='cid:logo.png'></img>", |
"inline_images": [ | "inline_images": [ |
{"card_id": "ffc3a027-2fed-45f8-8aa8-adec18a90439", "file_name": "logo.png"} | {"card_id": "ffc3a027-2fed-45f8-8aa8-adec18a90439", "file_name": "logo.png"} |
</code> | </code> |
| |
| As a response you receive a JSON with the following structure: |
| * errors [Array]: Contains information if no single email could be sent, otherwise it is empty. |
| * messages [Array]: Contains information if Protogrid could not establish the connection to the mail server with the most secure transport encryption, otherwise it is empty. |
| * result [Object]: Contains information regarding individual recipients to whom the email could not be delivered. If the email could be delivered to all recipients equals to { "success": true }. |
| |
Example result: | Example response: |
<code javascript> | <code javascript> |
{ | { |
"errors": [], | "errors": [], |
"result": { | "messages": |
"success": true | [ |
} | "Couldn't send the mail using a secure TlS communication channel. Trying SSL instead.", |
| "Couldn't send the mail an SSL communication channel. Trying without encryption." |
| ], |
| "result": |
| { |
| "external@recipient.ch": |
| [ |
| 554, |
| "5.7.1 <external@recipient.ch>: Relay access denied" |
| ] |
| } |
} | } |
</code> | </code> |