From 4be816a5d6aeddab134ec8183891c52e34853c89 Mon Sep 17 00:00:00 2001 From: Abhisek Mazumdar Date: Tue, 3 Sep 2024 18:48:25 +0530 Subject: [PATCH 1/4] Add emails REST API doc. --- docs/rest_api/emails.rst | 763 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 763 insertions(+) create mode 100644 docs/rest_api/emails.rst diff --git a/docs/rest_api/emails.rst b/docs/rest_api/emails.rst new file mode 100644 index 00000000..4806be14 --- /dev/null +++ b/docs/rest_api/emails.rst @@ -0,0 +1,763 @@ +Emails +###### + +Use this endpoint to obtain details, create, update or delete Mautic’s +emails. + +.. code-block:: php + + newAuth($settings); + $apiUrl = "https://your-mautic.com"; + $api = new MauticApi(); + $emailApi = $api->newApi("emails", $auth, $apiUrl); + +.. vale off + +Get Email +~~~~~~~~~ + +.. vale on + +.. code-block:: php + + get($id); + +.. code-block:: json + + { + "email":{ + "isPublished":true, + "dateAdded":"2016-10-25T18:51:17+00:00", + "createdBy":1, + "createdByUser":"John Doe", + "dateModified":null, + "modifiedBy":null, + "modifiedByUser":null, + "id":560, + "name":"test", + "subject":"API test email", + "language":"en", + "category":null, + "fromAddress":null, + "fromName":null, + "replyToAddress":null, + "bccAddress":null, + "customHtml":"

Hi there!<\/h1>", + "plainText":null, + "template":null, + "emailType":"list", + "publishUp":null, + "publishDown":null, + "readCount":0, + "sentCount":0, + "revision":1, + "assetAttachments":[], + "variantStartDate":null, + "variantSentCount":0, + "variantReadCount":0, + "variantParent":null, + "variantChildren":[], + "translationParent":null, + "translationChildren":[], + "unsubscribeForm":null, + "dynamicContent":[ + { + "tokenName":null, + "content":null, + "filters":[ + { + "content":null, + "filters":[ + { + "glue":null, + "field":null, + "object":null, + "type":null, + "operator":null, + "display":null, + "filter":null + } + ] + } + ] + } + ], + "lists":[ + { + "createdByUser":"John Doe", + "modifiedByUser":null, + "id":256, + "name":"test", + "alias":"test29", + "description":null + } + ] + } + } + +Get an individual email by ID. + +HTTP Request +^^^^^^^^^^^^ + +``GET /emails/ID`` + +Response +^^^^^^^^ + +``Expected Response Code: 200`` + +See JSON code example. + +**Email Properties** + ++--------------+--------------+----------------------------------------+ +| Name | Type | Description | ++==============+==============+========================================+ +| id | int | ID of the email | ++--------------+--------------+----------------------------------------+ +| name | string | Internal name of the email | ++--------------+--------------+----------------------------------------+ +| subject | stringl | Subject of the email | ++--------------+--------------+----------------------------------------+ +| fromAddress | string | The from email address if it’s | +| | | different than the one in the Mautic | +| | | configuration | ++--------------+--------------+----------------------------------------+ +| fromName | string | The from name if it’s different than | +| | | the one in the Mautic configuration | ++--------------+--------------+----------------------------------------+ +| re | string | The reply to email address if it’s | +| plyToAddress | | different than the one in the Mautic | +| | | configuration | ++--------------+--------------+----------------------------------------+ +| bccAddress | string | The BCC email address if it’s | +| | | different than the one in the Mautic | +| | | configuration | ++--------------+--------------+----------------------------------------+ +| isPublished | bool | Published state | ++--------------+--------------+----------------------------------------+ +| publishUp | d | Date/time when the email should be | +| | atetime/null | published | ++--------------+--------------+----------------------------------------+ +| publishDown | d | Date/time the email should be un | +| | atetime/null | published | ++--------------+--------------+----------------------------------------+ +| dateAdded | datetime | Date/time email was created | ++--------------+--------------+----------------------------------------+ +| createdBy | int | ID of the user that created the email | ++--------------+--------------+----------------------------------------+ +| c | string | Name of the user that created the | +| reatedByUser | | email | ++--------------+--------------+----------------------------------------+ +| dateModified | d | Date/time email was last modified | +| | atetime/null | | ++--------------+--------------+----------------------------------------+ +| modifiedBy | int | ID of the user that last modified the | +| | | email | ++--------------+--------------+----------------------------------------+ +| mo | string | Name of the user that last modified | +| difiedByUser | | the email | ++--------------+--------------+----------------------------------------+ +| language | string | Language locale of the email | ++--------------+--------------+----------------------------------------+ +| readCount | int | Total email read count | ++--------------+--------------+----------------------------------------+ +| sentCount | int | Total email sent count | ++--------------+--------------+----------------------------------------+ +| revision | int | Email revision | ++--------------+--------------+----------------------------------------+ +| customHtml | string | The HTML content of the email | ++--------------+--------------+----------------------------------------+ +| plainText | string | The plain text content of the email | ++--------------+--------------+----------------------------------------+ +| template | string | The name of the template used as the | +| | | base for the email | ++--------------+--------------+----------------------------------------+ +| emailType | string | If it is a segment (former list) email | +| | | or template email. Possible values are | +| | | ‘list’ and ‘template’ | ++--------------+--------------+----------------------------------------+ +| transla | array | Array of Page entities for | +| tionChildren | | translations of this landing page | ++--------------+--------------+----------------------------------------+ +| trans | object | The parent/main page if this is a | +| lationParent | | translation | ++--------------+--------------+----------------------------------------+ +| vari | int | Sent count since variantStartDate | +| antSentCount | | | ++--------------+--------------+----------------------------------------+ +| vari | int | Read count since variantStartDate | +| antReadCount | | | ++--------------+--------------+----------------------------------------+ +| var | array | Array of Email entities for variants | +| iantChildren | | of this landing email | ++--------------+--------------+----------------------------------------+ +| v | object | The parent/main email if this is a | +| ariantParent | | variant (A/B test) | ++--------------+--------------+----------------------------------------+ +| var | array | The properties of the A/B test | +| iantSettings | | | ++--------------+--------------+----------------------------------------+ +| vari | d | The date/time the A/B test began | +| antStartDate | atetime/null | | ++--------------+--------------+----------------------------------------+ +| category | object/null | Category information | ++--------------+--------------+----------------------------------------+ +| uns | int | Id of the form displayed in the | +| ubscribeForm | | unsubscribe page | ++--------------+--------------+----------------------------------------+ +| dy | object | Dynamic content configuration | +| namicContent | | | ++--------------+--------------+----------------------------------------+ +| lists | array | Array of segment IDs which should be | +| | | added to the segment email | ++--------------+--------------+----------------------------------------+ +| asse | array | asset IDs Array for email attachment | +| tAttachments | | | ++--------------+--------------+----------------------------------------+ + +List Emails +~~~~~~~~~~~ + +.. code-block:: php + + getList($searchFilter, $start, $limit, $orderBy, $orderByDir, $publishedOnly, $minimal); + +.. code-block:: json + + { + "total": 1, + "emails": [ + { + "isPublished":true, + "dateAdded":"2016-10-25T18:51:17+00:00", + "createdBy":1, + "createdByUser":"John Doe", + "dateModified":null, + "modifiedBy":null, + "modifiedByUser":null, + "id":560, + "name":"test", + "subject":"API test email", + "language":"en", + "category":null, + "fromAddress":null, + "fromName":null, + "replyToAddress":null, + "bccAddress":null, + "customHtml":"

Hi there!<\/h1>", + "plainText":null, + "template":null, + "emailType":"list", + "publishUp":null, + "publishDown":null, + "readCount":0, + "sentCount":0, + "revision":1, + "assetAttachments":[], + "variantStartDate":null, + "variantSentCount":0, + "variantReadCount":0, + "variantParent":null, + "variantChildren":[], + "translationParent":null, + "translationChildren":[], + "unsubscribeForm":null, + "dynamicContent":[ + { + "tokenName":null, + "content":null, + "filters":[ + { + "content":null, + "filters":[ + { + "glue":null, + "field":null, + "object":null, + "type":null, + "operator":null, + "display":null, + "filter":null + } + ] + } + ] + } + ], + "lists":[ + { + "createdByUser":"John Doe", + "modifiedByUser":null, + "id":256, + "name":"test", + "alias":"test29", + "description":null + } + ] + } + ] + } + +.. _http-request-1: + +HTTP Request +^^^^^^^^^^^^ + +``GET /emails`` + +**Query Parameters** + ++------------------+---------------------------------------------------+ +| Name | Description | ++==================+===================================================+ +| search | String or search command to filter entities by. | ++------------------+---------------------------------------------------+ +| start | Starting row for the entities returned. Defaults | +| | to 0. | ++------------------+---------------------------------------------------+ +| limit | Limit number of entities to return. Defaults to | +| | the system configuration for pagination (30). | ++------------------+---------------------------------------------------+ +| orderBy | Column to sort by. Can use any column listed in | +| | the response. | ++------------------+---------------------------------------------------+ +| orderByDir | Sort direction: asc or desc. | ++------------------+---------------------------------------------------+ +| publishedOnly | Only return currently published entities. | ++------------------+---------------------------------------------------+ +| minimal | Return only array of entities without additional | +| | lists in it. | ++------------------+---------------------------------------------------+ + +.. _response-1: + +Response +^^^^^^^^ + +``Expected Response Code: 200`` + +See JSON code example. + +**Properties** + +Same as `Get Email <#get-email>`__. + +Create Email +~~~~~~~~~~~~ + +.. code-block:: php + + 'Email A', + 'description' => 'This is my first email created via API.', + 'isPublished' => 1 + ); + + $email = $emailApi->create($data); + +Create a new email. + +.. _http-request-2: + +HTTP Request +^^^^^^^^^^^^ + +``POST /emails/new`` + +**Post Parameters** + ++--------------+--------------+----------------------------------------+ +| Name | Type | Description | ++==============+==============+========================================+ +| id | int | ID of the email | ++--------------+--------------+----------------------------------------+ +| name | string | Internal name of the email | ++--------------+--------------+----------------------------------------+ +| subject | stringl | Subject of the email | ++--------------+--------------+----------------------------------------+ +| fromAddress | string | The from email address if it’s | +| | | different than the one in the Mautic | +| | | configuration | ++--------------+--------------+----------------------------------------+ +| fromName | string | The from name if it’s different than | +| | | the one in the Mautic configuration | ++--------------+--------------+----------------------------------------+ +| re | string | The reply to email address if it’s | +| plyToAddress | | different than the one in the Mautic | +| | | configuration | ++--------------+--------------+----------------------------------------+ +| bccAddress | string | The BCC email address if it’s | +| | | different than the one in the Mautic | +| | | configuration | ++--------------+--------------+----------------------------------------+ +| isPublished | bool | Published state | ++--------------+--------------+----------------------------------------+ +| publishUp | d | Date/time when the email should be | +| | atetime/null | published | ++--------------+--------------+----------------------------------------+ +| publishDown | d | Date/time the email should be un | +| | atetime/null | published | ++--------------+--------------+----------------------------------------+ +| language | string | Language locale of the email | ++--------------+--------------+----------------------------------------+ +| readCount | int | Total email read count | ++--------------+--------------+----------------------------------------+ +| sentCount | int | Total email sent count | ++--------------+--------------+----------------------------------------+ +| revision | int | Email revision | ++--------------+--------------+----------------------------------------+ +| customHtml | string | The HTML content of the email | ++--------------+--------------+----------------------------------------+ +| plainText | string | The plain text content of the email | ++--------------+--------------+----------------------------------------+ +| template | string | The name of the template used as the | +| | | base for the email | ++--------------+--------------+----------------------------------------+ +| emailType | string | If it is a segment (former list) email | +| | | or template email. Possible values are | +| | | ‘list’ and ‘template’ | ++--------------+--------------+----------------------------------------+ +| transla | array | Array of Page entities for | +| tionChildren | | translations of this landing page | ++--------------+--------------+----------------------------------------+ +| trans | object | The parent/main page if this is a | +| lationParent | | translation | ++--------------+--------------+----------------------------------------+ +| vari | int | Sent count since variantStartDate | +| antSentCount | | | ++--------------+--------------+----------------------------------------+ +| vari | int | Read count since variantStartDate | +| antReadCount | | | ++--------------+--------------+----------------------------------------+ +| var | array | Array of Email entities for variants | +| iantChildren | | of this landing email | ++--------------+--------------+----------------------------------------+ +| v | object | The parent/main email if this is a | +| ariantParent | | variant (A/B test) | ++--------------+--------------+----------------------------------------+ +| var | array | The properties of the A/B test | +| iantSettings | | | ++--------------+--------------+----------------------------------------+ +| vari | d | The date/time the A/B test began | +| antStartDate | atetime/null | | ++--------------+--------------+----------------------------------------+ +| category | object/null | Category information | ++--------------+--------------+----------------------------------------+ +| uns | int | Id of the form displayed in the | +| ubscribeForm | | unsubscribe page | ++--------------+--------------+----------------------------------------+ +| dy | object | Dynamic content configuration | +| namicContent | | | ++--------------+--------------+----------------------------------------+ +| lists | array | Array of segment IDs which should be | +| | | added to the segment email | ++--------------+--------------+----------------------------------------+ + +.. _response-2: + +Response +^^^^^^^^ + +``Expected Response Code: 201`` + +**Properties** + +Same as `Get Email <#get-email>`__. + +Edit Email +~~~~~~~~~~ + +.. code-block:: php + + 'New email title', + 'isPublished' => 0 + ); + + // Create new a email of ID 1 is not found? + $createIfNotFound = true; + + $email = $emailApi->edit($id, $data, $createIfNotFound); + +Edit a new email. Note that this supports PUT or PATCH depending on the +desired behavior. + +**PUT** creates a email if the given ID does not exist and clears all +the email information, adds the information from the request. **PATCH** +fails if the email with the given ID does not exist and updates the +email field values with the values form the request. + +.. _http-request-3: + +HTTP Request +^^^^^^^^^^^^ + +To edit a email and return a 404 if the email is not found: + +``PATCH /emails/ID/edit`` + +To edit a email and create a new one if the email is not found: + +``PUT /emails/ID/edit`` + +**Post Parameters** + ++--------------+--------------+----------------------------------------+ +| Name | Type | Description | ++==============+==============+========================================+ +| id | int | ID of the email | ++--------------+--------------+----------------------------------------+ +| name | string | Internal name of the email | ++--------------+--------------+----------------------------------------+ +| subject | stringl | Subject of the email | ++--------------+--------------+----------------------------------------+ +| fromAddress | string | The from email address if it’s | +| | | different than the one in the Mautic | +| | | configuration | ++--------------+--------------+----------------------------------------+ +| fromName | string | The from name if it’s different than | +| | | the one in the Mautic configuration | ++--------------+--------------+----------------------------------------+ +| re | string | The reply to email address if it’s | +| plyToAddress | | different than the one in the Mautic | +| | | configuration | ++--------------+--------------+----------------------------------------+ +| bccAddress | string | The BCC email address if it’s | +| | | different than the one in the Mautic | +| | | configuration | ++--------------+--------------+----------------------------------------+ +| isPublished | bool | Published state | ++--------------+--------------+----------------------------------------+ +| publishUp | d | Date/time when the email should be | +| | atetime/null | published | ++--------------+--------------+----------------------------------------+ +| publishDown | d | Date/time the email should be un | +| | atetime/null | published | ++--------------+--------------+----------------------------------------+ +| language | string | Language locale of the email | ++--------------+--------------+----------------------------------------+ +| readCount | int | Total email read count | ++--------------+--------------+----------------------------------------+ +| sentCount | int | Total email sent count | ++--------------+--------------+----------------------------------------+ +| revision | int | Email revision | ++--------------+--------------+----------------------------------------+ +| customHtml | string | The HTML content of the email | ++--------------+--------------+----------------------------------------+ +| plainText | string | The plain text content of the email | ++--------------+--------------+----------------------------------------+ +| template | string | The name of the template used as the | +| | | base for the email | ++--------------+--------------+----------------------------------------+ +| emailType | string | If it is a segment (former list) email | +| | | or template email. Possible values are | +| | | ‘list’ and ‘template’ | ++--------------+--------------+----------------------------------------+ +| transla | array | Array of Page entities for | +| tionChildren | | translations of this landing page | ++--------------+--------------+----------------------------------------+ +| trans | object | The parent/main page if this is a | +| lationParent | | translation | ++--------------+--------------+----------------------------------------+ +| vari | int | Sent count since variantStartDate | +| antSentCount | | | ++--------------+--------------+----------------------------------------+ +| vari | int | Read count since variantStartDate | +| antReadCount | | | ++--------------+--------------+----------------------------------------+ +| var | array | Array of Email entities for variants | +| iantChildren | | of this landing email | ++--------------+--------------+----------------------------------------+ +| v | object | The parent/main email if this is a | +| ariantParent | | variant (A/B test) | ++--------------+--------------+----------------------------------------+ +| var | array | The properties of the A/B test | +| iantSettings | | | ++--------------+--------------+----------------------------------------+ +| vari | d | The date/time the A/B test began | +| antStartDate | atetime/null | | ++--------------+--------------+----------------------------------------+ +| category | object/null | Category information | ++--------------+--------------+----------------------------------------+ +| uns | int | Id of the form displayed in the | +| ubscribeForm | | unsubscribe page | ++--------------+--------------+----------------------------------------+ +| dy | object | Dynamic content configuration | +| namicContent | | | ++--------------+--------------+----------------------------------------+ +| lists | array | Array of segment IDs which should be | +| | | added to the segment email | ++--------------+--------------+----------------------------------------+ + +.. _response-3: + +Response +^^^^^^^^ + +If ``PUT``, the expected response code is ``200`` if the email was +edited or ``201`` if created. + +If ``PATCH``, the expected response code is ``200``. + +**Properties** + +Same as `Get Email <#get-email>`__. + +Delete Email +~~~~~~~~~~~~ + +.. code-block:: php + + delete($id); + +Delete a email. + +.. _http-request-4: + +HTTP Request +^^^^^^^^^^^^ + +``DELETE /emails/ID/delete`` + +.. _response-4: + +Response +^^^^^^^^ + +``Expected Response Code: 200`` + +**Properties** + +Same as `Get Email <#get-email>`__. + +Send Email to Contact +~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: php + + sendToContact($emailId, $contactId); + +Send a predefined email to existing contact. + +Assets can be referenced for attaching documents (either ids of existing +assets or ids returned by the `Create +Asset `__). + +.. _http-request-5: + +HTTP Request +^^^^^^^^^^^^ + +``POST /emails/ID/contact/CONTACT_ID/send`` + +**Post Parameters** + +================ ===== ======================== +Name Type Description +================ ===== ======================== +tokens array Array of tokens in email +assetAttachments array Array of asset ids +================ ===== ======================== + +.. _response-5: + +Response +^^^^^^^^ + +``Expected Response Code: 200`` + +**Properties** + +.. code-block:: json + + { + "success": 1 + } + +Send Email to Segment +~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: php + + send($id); + +Send a segment email to linked segment(s). + +.. _http-request-6: + +HTTP Request +^^^^^^^^^^^^ + +``POST /emails/ID/send`` + +.. _response-6: + +Response +^^^^^^^^ + +``Expected Response Code: 200`` + +**Properties** + +.. code-block:: json + + { + "success": 1, + "sentCount": 1, + "failedCount": 0 + } + +Create a reply to a send email send row +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This endpoint can create a record that a specific email stat row +received a reply. It will also mark an email send stat as read. + +.. _http-request-7: + +HTTP Request +^^^^^^^^^^^^ + +``POST /emails/reply/TRACKING_HASH`` + +Tracking hash is created as unique hash for each email send stat record. + +.. _response-7: + +Response +^^^^^^^^ + +``Expected Response Code: 200`` + +**Properties** + +.. code-block:: json + + { + "success": 1, + } \ No newline at end of file From aee9cb961d0eefac564f33272e4ad6c0c5f7adaf Mon Sep 17 00:00:00 2001 From: Abhisek Mazumdar Date: Tue, 10 Sep 2024 19:51:55 +0530 Subject: [PATCH 2/4] Fix table alignments. --- docs/rest_api/emails.rst | 593 ++++++++++++++++++++------------------- 1 file changed, 298 insertions(+), 295 deletions(-) diff --git a/docs/rest_api/emails.rst b/docs/rest_api/emails.rst index 4806be14..c9c70671 100644 --- a/docs/rest_api/emails.rst +++ b/docs/rest_api/emails.rst @@ -1,8 +1,8 @@ Emails ###### -Use this endpoint to obtain details, create, update or delete Mautic’s -emails. +Use this endpoint to obtain details, create, update, or delete Mautic’s +Emails. .. code-block:: php @@ -104,9 +104,9 @@ Get Email } } -Get an individual email by ID. +Get an individual Email by ID. -HTTP Request +HTTP request ^^^^^^^^^^^^ ``GET /emails/ID`` @@ -120,111 +120,111 @@ See JSON code example. **Email Properties** -+--------------+--------------+----------------------------------------+ -| Name | Type | Description | -+==============+==============+========================================+ -| id | int | ID of the email | -+--------------+--------------+----------------------------------------+ -| name | string | Internal name of the email | -+--------------+--------------+----------------------------------------+ -| subject | stringl | Subject of the email | -+--------------+--------------+----------------------------------------+ -| fromAddress | string | The from email address if it’s | -| | | different than the one in the Mautic | -| | | configuration | -+--------------+--------------+----------------------------------------+ -| fromName | string | The from name if it’s different than | -| | | the one in the Mautic configuration | -+--------------+--------------+----------------------------------------+ -| re | string | The reply to email address if it’s | -| plyToAddress | | different than the one in the Mautic | -| | | configuration | -+--------------+--------------+----------------------------------------+ -| bccAddress | string | The BCC email address if it’s | -| | | different than the one in the Mautic | -| | | configuration | -+--------------+--------------+----------------------------------------+ -| isPublished | bool | Published state | -+--------------+--------------+----------------------------------------+ -| publishUp | d | Date/time when the email should be | -| | atetime/null | published | -+--------------+--------------+----------------------------------------+ -| publishDown | d | Date/time the email should be un | -| | atetime/null | published | -+--------------+--------------+----------------------------------------+ -| dateAdded | datetime | Date/time email was created | -+--------------+--------------+----------------------------------------+ -| createdBy | int | ID of the user that created the email | -+--------------+--------------+----------------------------------------+ -| c | string | Name of the user that created the | -| reatedByUser | | email | -+--------------+--------------+----------------------------------------+ -| dateModified | d | Date/time email was last modified | -| | atetime/null | | -+--------------+--------------+----------------------------------------+ -| modifiedBy | int | ID of the user that last modified the | -| | | email | -+--------------+--------------+----------------------------------------+ -| mo | string | Name of the user that last modified | -| difiedByUser | | the email | -+--------------+--------------+----------------------------------------+ -| language | string | Language locale of the email | -+--------------+--------------+----------------------------------------+ -| readCount | int | Total email read count | -+--------------+--------------+----------------------------------------+ -| sentCount | int | Total email sent count | -+--------------+--------------+----------------------------------------+ -| revision | int | Email revision | -+--------------+--------------+----------------------------------------+ -| customHtml | string | The HTML content of the email | -+--------------+--------------+----------------------------------------+ -| plainText | string | The plain text content of the email | -+--------------+--------------+----------------------------------------+ -| template | string | The name of the template used as the | -| | | base for the email | -+--------------+--------------+----------------------------------------+ -| emailType | string | If it is a segment (former list) email | -| | | or template email. Possible values are | -| | | ‘list’ and ‘template’ | -+--------------+--------------+----------------------------------------+ -| transla | array | Array of Page entities for | -| tionChildren | | translations of this landing page | -+--------------+--------------+----------------------------------------+ -| trans | object | The parent/main page if this is a | -| lationParent | | translation | -+--------------+--------------+----------------------------------------+ -| vari | int | Sent count since variantStartDate | -| antSentCount | | | -+--------------+--------------+----------------------------------------+ -| vari | int | Read count since variantStartDate | -| antReadCount | | | -+--------------+--------------+----------------------------------------+ -| var | array | Array of Email entities for variants | -| iantChildren | | of this landing email | -+--------------+--------------+----------------------------------------+ -| v | object | The parent/main email if this is a | -| ariantParent | | variant (A/B test) | -+--------------+--------------+----------------------------------------+ -| var | array | The properties of the A/B test | -| iantSettings | | | -+--------------+--------------+----------------------------------------+ -| vari | d | The date/time the A/B test began | -| antStartDate | atetime/null | | -+--------------+--------------+----------------------------------------+ -| category | object/null | Category information | -+--------------+--------------+----------------------------------------+ -| uns | int | Id of the form displayed in the | -| ubscribeForm | | unsubscribe page | -+--------------+--------------+----------------------------------------+ -| dy | object | Dynamic content configuration | -| namicContent | | | -+--------------+--------------+----------------------------------------+ -| lists | array | Array of segment IDs which should be | -| | | added to the segment email | -+--------------+--------------+----------------------------------------+ -| asse | array | asset IDs Array for email attachment | -| tAttachments | | | -+--------------+--------------+----------------------------------------+ ++----------------------+--------------+----------------------------------------+ +| Name | Type | Description | ++======================+==============+========================================+ +| ``id`` | int | ID of the Email | ++----------------------+--------------+----------------------------------------+ +| ``name`` | string | Internal name of the email | ++----------------------+--------------+----------------------------------------+ +| ``subject`` | string | Subject of the Email | ++----------------------+--------------+----------------------------------------+ +| ``fromAddress`` | string | The from email address if it's | +| | | different than the one in the Mautic | +| | | configuration | ++----------------------+--------------+----------------------------------------+ +| ``fromName`` | string | The from name if it's different than | +| | | the one in the Mautic configuration | ++----------------------+--------------+----------------------------------------+ +| ``replyToAddress`` | string | The reply to email address if it's | +| | | different than the one in the Mautic | +| | | configuration | ++----------------------+--------------+----------------------------------------+ +| ``bccAddress`` | string | The BCC email address if it's | +| | | different than the one in the Mautic | +| | | configuration | ++----------------------+--------------+----------------------------------------+ +| ``isPublished`` | boolean | Published state | ++----------------------+--------------+----------------------------------------+ +| ``publishUp`` | datetime/null| Date/time when the email should be | +| | | published | ++----------------------+--------------+----------------------------------------+ +| ``publishDown`` | datetime/null| Date/time the email should be un | +| | | published | ++----------------------+--------------+----------------------------------------+ +| ``dateAdded`` | datetime | Date/time email was created | ++----------------------+--------------+----------------------------------------+ +| ``createdBy`` | int | ID of the user that created the email | ++----------------------+--------------+----------------------------------------+ +| ``createdByUser`` | string | Name of the user that created the | +| | | email | ++----------------------+--------------+----------------------------------------+ +| ``dateModified`` | datetime/null| Date/time email was last modified | +| | | | ++----------------------+--------------+----------------------------------------+ +| ``modifiedBy`` | int | ID of the user that last modified the | +| | | email | ++----------------------+--------------+----------------------------------------+ +| ``modifiedByUser`` | string | Name of the user that last modified | +| | | the email | ++----------------------+--------------+----------------------------------------+ +| ``language`` | string | Language locale of the email | ++----------------------+--------------+----------------------------------------+ +| ``readCount`` | int | Total email read count | ++----------------------+--------------+----------------------------------------+ +| ``sentCount`` | int | Total email sent count | ++----------------------+--------------+----------------------------------------+ +| ``revision`` | int | Email revision | ++----------------------+--------------+----------------------------------------+ +| ``customHtml`` | string | The HTML content of the email | ++----------------------+--------------+----------------------------------------+ +| ``plainText`` | string | The plain text content of the email | ++----------------------+--------------+----------------------------------------+ +| ``template`` | string | The name of the template used as the | +| | | base for the email | ++----------------------+--------------+----------------------------------------+ +| ``emailType`` | string | If it is a segment (former list) email | +| | | or template email. Possible values are | +| | | list and template | ++----------------------+--------------+----------------------------------------+ +| ``translationChildren``| array | Array of Page entities for | +| | | translations of this landing page | ++----------------------+--------------+----------------------------------------+ +| ``translationParent``| object | The parent/main page if this is a | +| | | translation | ++----------------------+--------------+----------------------------------------+ +| ``variantSentCount`` | int | Sent count since variantStartDate | +| | | | ++----------------------+--------------+----------------------------------------+ +| ``variantReadCount`` | int | Read count since variantStartDate | +| | | | ++----------------------+--------------+----------------------------------------+ +| ``variantChildren`` | array | Array of Email entities for variants | +| | | of this landing email | ++----------------------+--------------+----------------------------------------+ +| ``variantParent`` | object | The parent/main email if this is a | +| | | variant (A/B test) | ++----------------------+--------------+----------------------------------------+ +| ``variantSettings`` | array | The properties of the A/B test | +| | | | ++----------------------+--------------+----------------------------------------+ +| ``variantStartDate`` | datetime/null| The date/time the A/B test began | +| | | | ++----------------------+--------------+----------------------------------------+ +| ``category`` | object/null | Category information | ++----------------------+--------------+----------------------------------------+ +| ``unsubscribeForm`` | int | Id of the form displayed in the | +| | | unsubscribe page | ++----------------------+--------------+----------------------------------------+ +| ``dynamicContent`` | object | Dynamic content configuration | +| | | | ++----------------------+--------------+----------------------------------------+ +| ``lists`` | array | Array of segment IDs which should be | +| | | added to the segment email | ++----------------------+--------------+----------------------------------------+ +| ``assetAttachments`` | array | asset IDs Array for email attachment | +| | | | ++----------------------+--------------+----------------------------------------+ List Emails ~~~~~~~~~~~ @@ -314,7 +314,7 @@ List Emails .. _http-request-1: -HTTP Request +HTTP request ^^^^^^^^^^^^ ``GET /emails`` @@ -324,22 +324,22 @@ HTTP Request +------------------+---------------------------------------------------+ | Name | Description | +==================+===================================================+ -| search | String or search command to filter entities by. | +| ``search`` | String or search command to filter entities by. | +------------------+---------------------------------------------------+ -| start | Starting row for the entities returned. Defaults | +| ``start`` | Starting row for the entities returned. Defaults | | | to 0. | +------------------+---------------------------------------------------+ -| limit | Limit number of entities to return. Defaults to | +| ``limit`` | Limit number of entities to return. Defaults to | | | the system configuration for pagination (30). | +------------------+---------------------------------------------------+ -| orderBy | Column to sort by. Can use any column listed in | +| ``orderBy`` | Column to sort by. Can use any column listed in | | | the response. | +------------------+---------------------------------------------------+ -| orderByDir | Sort direction: asc or desc. | +| ``orderByDir`` | Sort direction: asc or desc. | +------------------+---------------------------------------------------+ -| publishedOnly | Only return currently published entities. | +| ``publishedOnly``| Only return currently published entities. | +------------------+---------------------------------------------------+ -| minimal | Return only array of entities without additional | +| ``minimal`` | Return only array of entities without additional | | | lists in it. | +------------------+---------------------------------------------------+ @@ -375,99 +375,102 @@ Create a new email. .. _http-request-2: -HTTP Request +HTTP request ^^^^^^^^^^^^ ``POST /emails/new`` **Post Parameters** -+--------------+--------------+----------------------------------------+ -| Name | Type | Description | -+==============+==============+========================================+ -| id | int | ID of the email | -+--------------+--------------+----------------------------------------+ -| name | string | Internal name of the email | -+--------------+--------------+----------------------------------------+ -| subject | stringl | Subject of the email | -+--------------+--------------+----------------------------------------+ -| fromAddress | string | The from email address if it’s | -| | | different than the one in the Mautic | -| | | configuration | -+--------------+--------------+----------------------------------------+ -| fromName | string | The from name if it’s different than | -| | | the one in the Mautic configuration | -+--------------+--------------+----------------------------------------+ -| re | string | The reply to email address if it’s | -| plyToAddress | | different than the one in the Mautic | -| | | configuration | -+--------------+--------------+----------------------------------------+ -| bccAddress | string | The BCC email address if it’s | -| | | different than the one in the Mautic | -| | | configuration | -+--------------+--------------+----------------------------------------+ -| isPublished | bool | Published state | -+--------------+--------------+----------------------------------------+ -| publishUp | d | Date/time when the email should be | -| | atetime/null | published | -+--------------+--------------+----------------------------------------+ -| publishDown | d | Date/time the email should be un | -| | atetime/null | published | -+--------------+--------------+----------------------------------------+ -| language | string | Language locale of the email | -+--------------+--------------+----------------------------------------+ -| readCount | int | Total email read count | -+--------------+--------------+----------------------------------------+ -| sentCount | int | Total email sent count | -+--------------+--------------+----------------------------------------+ -| revision | int | Email revision | -+--------------+--------------+----------------------------------------+ -| customHtml | string | The HTML content of the email | -+--------------+--------------+----------------------------------------+ -| plainText | string | The plain text content of the email | -+--------------+--------------+----------------------------------------+ -| template | string | The name of the template used as the | -| | | base for the email | -+--------------+--------------+----------------------------------------+ -| emailType | string | If it is a segment (former list) email | -| | | or template email. Possible values are | -| | | ‘list’ and ‘template’ | -+--------------+--------------+----------------------------------------+ -| transla | array | Array of Page entities for | -| tionChildren | | translations of this landing page | -+--------------+--------------+----------------------------------------+ -| trans | object | The parent/main page if this is a | -| lationParent | | translation | -+--------------+--------------+----------------------------------------+ -| vari | int | Sent count since variantStartDate | -| antSentCount | | | -+--------------+--------------+----------------------------------------+ -| vari | int | Read count since variantStartDate | -| antReadCount | | | -+--------------+--------------+----------------------------------------+ -| var | array | Array of Email entities for variants | -| iantChildren | | of this landing email | -+--------------+--------------+----------------------------------------+ -| v | object | The parent/main email if this is a | -| ariantParent | | variant (A/B test) | -+--------------+--------------+----------------------------------------+ -| var | array | The properties of the A/B test | -| iantSettings | | | -+--------------+--------------+----------------------------------------+ -| vari | d | The date/time the A/B test began | -| antStartDate | atetime/null | | -+--------------+--------------+----------------------------------------+ -| category | object/null | Category information | -+--------------+--------------+----------------------------------------+ -| uns | int | Id of the form displayed in the | -| ubscribeForm | | unsubscribe page | -+--------------+--------------+----------------------------------------+ -| dy | object | Dynamic content configuration | -| namicContent | | | -+--------------+--------------+----------------------------------------+ -| lists | array | Array of segment IDs which should be | -| | | added to the segment email | -+--------------+--------------+----------------------------------------+ ++----------------------+--------------+----------------------------------------+ +| Name | Type | Description | ++----------------------+--------------+----------------------------------------+ +| ``id`` | int | ID of the Email | ++----------------------+--------------+----------------------------------------+ +| ``name`` | string | Internal name of the email | ++----------------------+--------------+----------------------------------------+ +| ``subject`` | string | Subject of the Email | ++----------------------+--------------+----------------------------------------+ +| ``fromAddress`` | string | The from email address if it's | +| | | different than the one in the Mautic | +| | | configuration | ++----------------------+--------------+----------------------------------------+ +| ``fromName`` | string | The from name if it's different than | +| | | the one in the Mautic configuration | ++----------------------+--------------+----------------------------------------+ +| ``replyToAddress`` | string | The reply to email address if it's | +| | | different than the one in the Mautic | +| | | configuration | ++----------------------+--------------+----------------------------------------+ +| ``bccAddress`` | string | The BCC email address if it's | +| | | different than the one in the Mautic | +| | | configuration | ++----------------------+--------------+----------------------------------------+ +| ``isPublished`` | boolean | Published state | ++----------------------+--------------+----------------------------------------+ +| ``publishUp`` | datetime/null| Date/time when the email should be | +| | | published | ++----------------------+--------------+----------------------------------------+ +| ``publishDown`` | datetime/null| Date/time the email should be un | +| | | published | ++----------------------+--------------+----------------------------------------+ +| ``language`` | string | Language locale of the email | ++----------------------+--------------+----------------------------------------+ +| ``readCount`` | int | Total email read count | ++----------------------+--------------+----------------------------------------+ +| ``sentCount`` | int | Total email sent count | ++----------------------+--------------+----------------------------------------+ +| ``revision`` | int | Email revision | ++----------------------+--------------+----------------------------------------+ +| ``customHtml`` | string | The HTML content of the email | ++----------------------+--------------+----------------------------------------+ +| ``plainText`` | string | The plain text content of the email | ++----------------------+--------------+----------------------------------------+ +| ``template`` | string | The name of the template used as the | +| | | base for the email | ++----------------------+--------------+----------------------------------------+ +| ``emailType`` | string | If it is a segment (former list) email | +| | | or template email. Possible values are | +| | | list and template | ++----------------------+--------------+----------------------------------------+ +| ``translationChildren``| array | Array of Page entities for | +| | | translations of this landing page | ++----------------------+--------------+----------------------------------------+ +| ``translationParent``| object | The parent/main page if this is a | +| | | translation | ++----------------------+--------------+----------------------------------------+ +| ``variantSentCount`` | int | Sent count since variantStartDate | +| | | | ++----------------------+--------------+----------------------------------------+ +| ``variantReadCount`` | int | Read count since variantStartDate | +| | | | ++----------------------+--------------+----------------------------------------+ +| ``variantChildren`` | array | Array of Email entities for variants | +| | | of this landing email | ++----------------------+--------------+----------------------------------------+ +| ``variantParent`` | object | The parent/main email if this is a | +| | | variant (A/B test) | ++----------------------+--------------+----------------------------------------+ +| ``variantSettings`` | array | The properties of the A/B test | +| | | | ++----------------------+--------------+----------------------------------------+ +| ``variantStartDate`` | datetime/null| The date/time the A/B test began | +| | | | ++----------------------+--------------+----------------------------------------+ +| ``category`` | object/null | Category information | ++----------------------+--------------+----------------------------------------+ +| ``unsubscribeForm`` | int | Id of the form displayed in the | +| | | unsubscribe page | ++----------------------+--------------+----------------------------------------+ +| ``dynamicContent`` | object | Dynamic content configuration | +| | | | ++----------------------+--------------+----------------------------------------+ +| ``lists`` | array | Array of segment IDs which should be | +| | | added to the segment email | ++----------------------+--------------+----------------------------------------+ +| ``assetAttachments`` | array | asset IDs Array for email attachment | +| | | | ++----------------------+--------------+----------------------------------------+ .. _response-2: @@ -508,7 +511,7 @@ email field values with the values form the request. .. _http-request-3: -HTTP Request +HTTP request ^^^^^^^^^^^^ To edit a email and return a 404 if the email is not found: @@ -521,92 +524,92 @@ To edit a email and create a new one if the email is not found: **Post Parameters** -+--------------+--------------+----------------------------------------+ -| Name | Type | Description | -+==============+==============+========================================+ -| id | int | ID of the email | -+--------------+--------------+----------------------------------------+ -| name | string | Internal name of the email | -+--------------+--------------+----------------------------------------+ -| subject | stringl | Subject of the email | -+--------------+--------------+----------------------------------------+ -| fromAddress | string | The from email address if it’s | -| | | different than the one in the Mautic | -| | | configuration | -+--------------+--------------+----------------------------------------+ -| fromName | string | The from name if it’s different than | -| | | the one in the Mautic configuration | -+--------------+--------------+----------------------------------------+ -| re | string | The reply to email address if it’s | -| plyToAddress | | different than the one in the Mautic | -| | | configuration | -+--------------+--------------+----------------------------------------+ -| bccAddress | string | The BCC email address if it’s | -| | | different than the one in the Mautic | -| | | configuration | -+--------------+--------------+----------------------------------------+ -| isPublished | bool | Published state | -+--------------+--------------+----------------------------------------+ -| publishUp | d | Date/time when the email should be | -| | atetime/null | published | -+--------------+--------------+----------------------------------------+ -| publishDown | d | Date/time the email should be un | -| | atetime/null | published | -+--------------+--------------+----------------------------------------+ -| language | string | Language locale of the email | -+--------------+--------------+----------------------------------------+ -| readCount | int | Total email read count | -+--------------+--------------+----------------------------------------+ -| sentCount | int | Total email sent count | -+--------------+--------------+----------------------------------------+ -| revision | int | Email revision | -+--------------+--------------+----------------------------------------+ -| customHtml | string | The HTML content of the email | -+--------------+--------------+----------------------------------------+ -| plainText | string | The plain text content of the email | -+--------------+--------------+----------------------------------------+ -| template | string | The name of the template used as the | -| | | base for the email | -+--------------+--------------+----------------------------------------+ -| emailType | string | If it is a segment (former list) email | -| | | or template email. Possible values are | -| | | ‘list’ and ‘template’ | -+--------------+--------------+----------------------------------------+ -| transla | array | Array of Page entities for | -| tionChildren | | translations of this landing page | -+--------------+--------------+----------------------------------------+ -| trans | object | The parent/main page if this is a | -| lationParent | | translation | -+--------------+--------------+----------------------------------------+ -| vari | int | Sent count since variantStartDate | -| antSentCount | | | -+--------------+--------------+----------------------------------------+ -| vari | int | Read count since variantStartDate | -| antReadCount | | | -+--------------+--------------+----------------------------------------+ -| var | array | Array of Email entities for variants | -| iantChildren | | of this landing email | -+--------------+--------------+----------------------------------------+ -| v | object | The parent/main email if this is a | -| ariantParent | | variant (A/B test) | -+--------------+--------------+----------------------------------------+ -| var | array | The properties of the A/B test | -| iantSettings | | | -+--------------+--------------+----------------------------------------+ -| vari | d | The date/time the A/B test began | -| antStartDate | atetime/null | | -+--------------+--------------+----------------------------------------+ -| category | object/null | Category information | -+--------------+--------------+----------------------------------------+ -| uns | int | Id of the form displayed in the | -| ubscribeForm | | unsubscribe page | -+--------------+--------------+----------------------------------------+ -| dy | object | Dynamic content configuration | -| namicContent | | | -+--------------+--------------+----------------------------------------+ -| lists | array | Array of segment IDs which should be | -| | | added to the segment email | -+--------------+--------------+----------------------------------------+ ++------------------------+--------------+----------------------------------------+ +| Name | Type | Description | ++------------------------+--------------+----------------------------------------+ +| ``id`` | int | ID of the Email | ++------------------------+--------------+----------------------------------------+ +| ``name`` | string | Internal name of the Email | ++------------------------+--------------+----------------------------------------+ +| ``subject`` | string | Subject of the Email | ++------------------------+--------------+----------------------------------------+ +| ``fromAddress`` | string | The from email address if it's | +| | | different than the one in the Mautic | +| | | configuration | ++------------------------+--------------+----------------------------------------+ +| ``fromName`` | string | The from name if it's different than | +| | | the one in the Mautic configuration | ++------------------------+--------------+----------------------------------------+ +| ``replyToAddress`` | string | The reply to email address if it's | +| | | different than the one in the Mautic | +| | | configuration | ++------------------------+--------------+----------------------------------------+ +| ``bccAddress`` | string | The BCC email address if it's | +| | | different than the one in the Mautic | +| | | configuration | ++------------------------+--------------+----------------------------------------+ +| ``isPublished`` | boolean | Published state | ++------------------------+--------------+----------------------------------------+ +| ``publishUp`` | datetime/null| Date/time when the email should be | +| | | published | ++------------------------+--------------+----------------------------------------+ +| ``publishDown`` | datetime/null| Date/time the email should be un | +| | | published | ++------------------------+--------------+----------------------------------------+ +| ``language`` | string | Language locale of the email | ++------------------------+--------------+----------------------------------------+ +| ``readCount`` | int | Total email read count | ++------------------------+--------------+----------------------------------------+ +| ``sentCount`` | int | Total email sent count | ++------------------------+--------------+----------------------------------------+ +| ``revision`` | int | Email revision | ++------------------------+--------------+----------------------------------------+ +| ``customHtml`` | string | The HTML content of the email | ++------------------------+--------------+----------------------------------------+ +| ``plainText`` | string | The plain text content of the email | ++------------------------+--------------+----------------------------------------+ +| ``template`` | string | The name of the template used as the | +| | | base for the email | ++------------------------+--------------+----------------------------------------+ +| ``emailType`` | string | If it is a segment (former list) email | +| | | or template email. Possible values are | +| | | list and template | ++------------------------+--------------+----------------------------------------+ +| ``translationChildren``| array | Array of Page entities for | +| | | translations of this landing page | ++------------------------+--------------+----------------------------------------+ +| ``translationParent`` | object | The parent/main page if this is a | +| | | translation | ++------------------------+--------------+----------------------------------------+ +| ``variantSentCount`` | int | Sent count since variantStartDate | +| | | | ++------------------------+--------------+----------------------------------------+ +| ``variantReadCount`` | int | Read count since variantStartDate | +| | | | ++------------------------+--------------+----------------------------------------+ +| ``variantChildren`` | array | Array of Email entities for variants | +| | | of this landing email | ++------------------------+--------------+----------------------------------------+ +| ``variantParent`` | object | The parent/main email if this is a | +| | | variant (A/B test) | ++------------------------+--------------+----------------------------------------+ +| ``variantSettings`` | array | The properties of the A/B test | +| | | | ++------------------------+--------------+----------------------------------------+ +| ``variantStartDate`` | datetime/null| The date/time the A/B test began | +| | | | ++------------------------+--------------+----------------------------------------+ +| ``category`` | object/null | Category information | ++------------------------+--------------+----------------------------------------+ +| ``unsubscribeForm`` | int | Id of the form displayed in the | +| | | unsubscribe page | ++------------------------+--------------+----------------------------------------+ +| ``dynamicContent`` | object | Dynamic content configuration | +| | | | ++------------------------+--------------+----------------------------------------+ +| ``lists`` | array | Array of segment IDs which should be | +| | | added to the segment email | ++------------------------+--------------+----------------------------------------+ .. _response-3: @@ -635,7 +638,7 @@ Delete a email. .. _http-request-4: -HTTP Request +HTTP request ^^^^^^^^^^^^ ``DELETE /emails/ID/delete`` @@ -668,7 +671,7 @@ Asset Date: Tue, 10 Sep 2024 19:56:36 +0530 Subject: [PATCH 3/4] email to Email. --- docs/rest_api/emails.rst | 148 +++++++++++++++++++-------------------- 1 file changed, 74 insertions(+), 74 deletions(-) diff --git a/docs/rest_api/emails.rst b/docs/rest_api/emails.rst index c9c70671..5013e769 100644 --- a/docs/rest_api/emails.rst +++ b/docs/rest_api/emails.rst @@ -125,66 +125,66 @@ See JSON code example. +======================+==============+========================================+ | ``id`` | int | ID of the Email | +----------------------+--------------+----------------------------------------+ -| ``name`` | string | Internal name of the email | +| ``name`` | string | Internal name of the Email | +----------------------+--------------+----------------------------------------+ | ``subject`` | string | Subject of the Email | +----------------------+--------------+----------------------------------------+ -| ``fromAddress`` | string | The from email address if it's | +| ``fromAddress`` | string | The from Email address if it's | | | | different than the one in the Mautic | | | | configuration | +----------------------+--------------+----------------------------------------+ | ``fromName`` | string | The from name if it's different than | | | | the one in the Mautic configuration | +----------------------+--------------+----------------------------------------+ -| ``replyToAddress`` | string | The reply to email address if it's | +| ``replyToAddress`` | string | The reply to Email address if it's | | | | different than the one in the Mautic | | | | configuration | +----------------------+--------------+----------------------------------------+ -| ``bccAddress`` | string | The BCC email address if it's | +| ``bccAddress`` | string | The BCC Email address if it's | | | | different than the one in the Mautic | | | | configuration | +----------------------+--------------+----------------------------------------+ | ``isPublished`` | boolean | Published state | +----------------------+--------------+----------------------------------------+ -| ``publishUp`` | datetime/null| Date/time when the email should be | +| ``publishUp`` | datetime/null| Date/time when the Email should be | | | | published | +----------------------+--------------+----------------------------------------+ -| ``publishDown`` | datetime/null| Date/time the email should be un | +| ``publishDown`` | datetime/null| Date/time the Email should be un | | | | published | +----------------------+--------------+----------------------------------------+ -| ``dateAdded`` | datetime | Date/time email was created | +| ``dateAdded`` | datetime | Date/time Email was created | +----------------------+--------------+----------------------------------------+ -| ``createdBy`` | int | ID of the user that created the email | +| ``createdBy`` | int | ID of the user that created the Email | +----------------------+--------------+----------------------------------------+ | ``createdByUser`` | string | Name of the user that created the | -| | | email | +| | | Email | +----------------------+--------------+----------------------------------------+ -| ``dateModified`` | datetime/null| Date/time email was last modified | +| ``dateModified`` | datetime/null| Date/time Email was last modified | | | | | +----------------------+--------------+----------------------------------------+ | ``modifiedBy`` | int | ID of the user that last modified the | -| | | email | +| | | Email | +----------------------+--------------+----------------------------------------+ | ``modifiedByUser`` | string | Name of the user that last modified | -| | | the email | +| | | the Email | +----------------------+--------------+----------------------------------------+ -| ``language`` | string | Language locale of the email | +| ``language`` | string | Language locale of the Email | +----------------------+--------------+----------------------------------------+ -| ``readCount`` | int | Total email read count | +| ``readCount`` | int | Total Email read count | +----------------------+--------------+----------------------------------------+ -| ``sentCount`` | int | Total email sent count | +| ``sentCount`` | int | Total Email sent count | +----------------------+--------------+----------------------------------------+ | ``revision`` | int | Email revision | +----------------------+--------------+----------------------------------------+ -| ``customHtml`` | string | The HTML content of the email | +| ``customHtml`` | string | The HTML content of the Email | +----------------------+--------------+----------------------------------------+ -| ``plainText`` | string | The plain text content of the email | +| ``plainText`` | string | The plain text content of the Email | +----------------------+--------------+----------------------------------------+ | ``template`` | string | The name of the template used as the | -| | | base for the email | +| | | base for the Email | +----------------------+--------------+----------------------------------------+ -| ``emailType`` | string | If it is a segment (former list) email | -| | | or template email. Possible values are | +| ``EmailType`` | string | If it is a segment (former list) Email | +| | | or template Email. Possible values are | | | | list and template | +----------------------+--------------+----------------------------------------+ | ``translationChildren``| array | Array of Page entities for | @@ -200,9 +200,9 @@ See JSON code example. | | | | +----------------------+--------------+----------------------------------------+ | ``variantChildren`` | array | Array of Email entities for variants | -| | | of this landing email | +| | | of this landing Email | +----------------------+--------------+----------------------------------------+ -| ``variantParent`` | object | The parent/main email if this is a | +| ``variantParent`` | object | The parent/main Email if this is a | | | | variant (A/B test) | +----------------------+--------------+----------------------------------------+ | ``variantSettings`` | array | The properties of the A/B test | @@ -220,9 +220,9 @@ See JSON code example. | | | | +----------------------+--------------+----------------------------------------+ | ``lists`` | array | Array of segment IDs which should be | -| | | added to the segment email | +| | | added to the segment Email | +----------------------+--------------+----------------------------------------+ -| ``assetAttachments`` | array | asset IDs Array for email attachment | +| ``assetAttachments`` | array | asset IDs Array for Email attachment | | | | | +----------------------+--------------+----------------------------------------+ @@ -371,7 +371,7 @@ Create Email $email = $emailApi->create($data); -Create a new email. +Create a new Email. .. _http-request-2: @@ -387,50 +387,50 @@ HTTP request +----------------------+--------------+----------------------------------------+ | ``id`` | int | ID of the Email | +----------------------+--------------+----------------------------------------+ -| ``name`` | string | Internal name of the email | +| ``name`` | string | Internal name of the Email | +----------------------+--------------+----------------------------------------+ | ``subject`` | string | Subject of the Email | +----------------------+--------------+----------------------------------------+ -| ``fromAddress`` | string | The from email address if it's | +| ``fromAddress`` | string | The from Email address if it's | | | | different than the one in the Mautic | | | | configuration | +----------------------+--------------+----------------------------------------+ | ``fromName`` | string | The from name if it's different than | | | | the one in the Mautic configuration | +----------------------+--------------+----------------------------------------+ -| ``replyToAddress`` | string | The reply to email address if it's | +| ``replyToAddress`` | string | The reply to Email address if it's | | | | different than the one in the Mautic | | | | configuration | +----------------------+--------------+----------------------------------------+ -| ``bccAddress`` | string | The BCC email address if it's | +| ``bccAddress`` | string | The BCC Email address if it's | | | | different than the one in the Mautic | | | | configuration | +----------------------+--------------+----------------------------------------+ | ``isPublished`` | boolean | Published state | +----------------------+--------------+----------------------------------------+ -| ``publishUp`` | datetime/null| Date/time when the email should be | +| ``publishUp`` | datetime/null| Date/time when the Email should be | | | | published | +----------------------+--------------+----------------------------------------+ -| ``publishDown`` | datetime/null| Date/time the email should be un | +| ``publishDown`` | datetime/null| Date/time the Email should be un | | | | published | +----------------------+--------------+----------------------------------------+ -| ``language`` | string | Language locale of the email | +| ``language`` | string | Language locale of the Email | +----------------------+--------------+----------------------------------------+ -| ``readCount`` | int | Total email read count | +| ``readCount`` | int | Total Email read count | +----------------------+--------------+----------------------------------------+ -| ``sentCount`` | int | Total email sent count | +| ``sentCount`` | int | Total Email sent count | +----------------------+--------------+----------------------------------------+ | ``revision`` | int | Email revision | +----------------------+--------------+----------------------------------------+ -| ``customHtml`` | string | The HTML content of the email | +| ``customHtml`` | string | The HTML content of the Email | +----------------------+--------------+----------------------------------------+ -| ``plainText`` | string | The plain text content of the email | +| ``plainText`` | string | The plain text content of the Email | +----------------------+--------------+----------------------------------------+ | ``template`` | string | The name of the template used as the | -| | | base for the email | +| | | base for the Email | +----------------------+--------------+----------------------------------------+ -| ``emailType`` | string | If it is a segment (former list) email | -| | | or template email. Possible values are | +| ``emailType`` | string | If it is a segment (former list) Email | +| | | or template Email. Possible values are | | | | list and template | +----------------------+--------------+----------------------------------------+ | ``translationChildren``| array | Array of Page entities for | @@ -446,9 +446,9 @@ HTTP request | | | | +----------------------+--------------+----------------------------------------+ | ``variantChildren`` | array | Array of Email entities for variants | -| | | of this landing email | +| | | of this landing Email | +----------------------+--------------+----------------------------------------+ -| ``variantParent`` | object | The parent/main email if this is a | +| ``variantParent`` | object | The parent/main Email if this is a | | | | variant (A/B test) | +----------------------+--------------+----------------------------------------+ | ``variantSettings`` | array | The properties of the A/B test | @@ -466,9 +466,9 @@ HTTP request | | | | +----------------------+--------------+----------------------------------------+ | ``lists`` | array | Array of segment IDs which should be | -| | | added to the segment email | +| | | added to the segment Email | +----------------------+--------------+----------------------------------------+ -| ``assetAttachments`` | array | asset IDs Array for email attachment | +| ``assetAttachments`` | array | asset IDs Array for Email attachment | | | | | +----------------------+--------------+----------------------------------------+ @@ -501,24 +501,24 @@ Edit Email $email = $emailApi->edit($id, $data, $createIfNotFound); -Edit a new email. Note that this supports PUT or PATCH depending on the +Edit a new Email. Note that this supports PUT or PATCH depending on the desired behavior. -**PUT** creates a email if the given ID does not exist and clears all -the email information, adds the information from the request. **PATCH** -fails if the email with the given ID does not exist and updates the -email field values with the values form the request. +**PUT** creates a Email if the given ID does not exist and clears all +the Email information, adds the information from the request. **PATCH** +fails if the Email with the given ID does not exist and updates the +Email field values with the values form the request. .. _http-request-3: HTTP request ^^^^^^^^^^^^ -To edit a email and return a 404 if the email is not found: +To edit a Email and return a 404 if the Email is not found: ``PATCH /emails/ID/edit`` -To edit a email and create a new one if the email is not found: +To edit a Email and create a new one if the Email is not found: ``PUT /emails/ID/edit`` @@ -533,46 +533,46 @@ To edit a email and create a new one if the email is not found: +------------------------+--------------+----------------------------------------+ | ``subject`` | string | Subject of the Email | +------------------------+--------------+----------------------------------------+ -| ``fromAddress`` | string | The from email address if it's | +| ``fromAddress`` | string | The from Email address if it's | | | | different than the one in the Mautic | | | | configuration | +------------------------+--------------+----------------------------------------+ | ``fromName`` | string | The from name if it's different than | | | | the one in the Mautic configuration | +------------------------+--------------+----------------------------------------+ -| ``replyToAddress`` | string | The reply to email address if it's | +| ``replyToAddress`` | string | The reply to Email address if it's | | | | different than the one in the Mautic | | | | configuration | +------------------------+--------------+----------------------------------------+ -| ``bccAddress`` | string | The BCC email address if it's | +| ``bccAddress`` | string | The BCC Email address if it's | | | | different than the one in the Mautic | | | | configuration | +------------------------+--------------+----------------------------------------+ | ``isPublished`` | boolean | Published state | +------------------------+--------------+----------------------------------------+ -| ``publishUp`` | datetime/null| Date/time when the email should be | +| ``publishUp`` | datetime/null| Date/time when the Email should be | | | | published | +------------------------+--------------+----------------------------------------+ -| ``publishDown`` | datetime/null| Date/time the email should be un | +| ``publishDown`` | datetime/null| Date/time the Email should be un | | | | published | +------------------------+--------------+----------------------------------------+ -| ``language`` | string | Language locale of the email | +| ``language`` | string | Language locale of the Email | +------------------------+--------------+----------------------------------------+ -| ``readCount`` | int | Total email read count | +| ``readCount`` | int | Total Email read count | +------------------------+--------------+----------------------------------------+ -| ``sentCount`` | int | Total email sent count | +| ``sentCount`` | int | Total Email sent count | +------------------------+--------------+----------------------------------------+ | ``revision`` | int | Email revision | +------------------------+--------------+----------------------------------------+ -| ``customHtml`` | string | The HTML content of the email | +| ``customHtml`` | string | The HTML content of the Email | +------------------------+--------------+----------------------------------------+ -| ``plainText`` | string | The plain text content of the email | +| ``plainText`` | string | The plain text content of the Email | +------------------------+--------------+----------------------------------------+ | ``template`` | string | The name of the template used as the | -| | | base for the email | +| | | base for the Email | +------------------------+--------------+----------------------------------------+ -| ``emailType`` | string | If it is a segment (former list) email | -| | | or template email. Possible values are | +| ``emailType`` | string | If it is a segment (former list) Email | +| | | or template Email. Possible values are | | | | list and template | +------------------------+--------------+----------------------------------------+ | ``translationChildren``| array | Array of Page entities for | @@ -588,9 +588,9 @@ To edit a email and create a new one if the email is not found: | | | | +------------------------+--------------+----------------------------------------+ | ``variantChildren`` | array | Array of Email entities for variants | -| | | of this landing email | +| | | of this landing Email | +------------------------+--------------+----------------------------------------+ -| ``variantParent`` | object | The parent/main email if this is a | +| ``variantParent`` | object | The parent/main Email if this is a | | | | variant (A/B test) | +------------------------+--------------+----------------------------------------+ | ``variantSettings`` | array | The properties of the A/B test | @@ -608,7 +608,7 @@ To edit a email and create a new one if the email is not found: | | | | +------------------------+--------------+----------------------------------------+ | ``lists`` | array | Array of segment IDs which should be | -| | | added to the segment email | +| | | added to the segment Email | +------------------------+--------------+----------------------------------------+ .. _response-3: @@ -616,7 +616,7 @@ To edit a email and create a new one if the email is not found: Response ^^^^^^^^ -If ``PUT``, the expected response code is ``200`` if the email was +If ``PUT``, the expected response code is ``200`` if the Email was edited or ``201`` if created. If ``PATCH``, the expected response code is ``200``. @@ -663,7 +663,7 @@ Send Email to Contact $email = $emailApi->sendToContact($emailId, $contactId); -Send a predefined email to existing contact. +Send a predefined Email to existing contact. Assets can be referenced for attaching documents (either ids of existing assets or ids returned by the `Create @@ -681,7 +681,7 @@ HTTP request ================ ===== ======================== Name Type Description ================ ===== ======================== -tokens array Array of tokens in email +tokens array Array of tokens in Email assetAttachments array Array of asset ids ================ ===== ======================== @@ -709,7 +709,7 @@ Send Email to Segment $email = $emailApi->send($id); -Send a segment email to linked segment(s). +Send a segment Email to linked segment(s). .. _http-request-6: @@ -735,11 +735,11 @@ Response "failedCount": 0 } -Create a reply to a send email send row +Create a reply to a send Email send row ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -This endpoint can create a record that a specific email stat row -received a reply. It will also mark an email send stat as read. +This endpoint can create a record that a specific Email stat row +received a reply. It will also mark an Email send stat as read. .. _http-request-7: @@ -748,7 +748,7 @@ HTTP request ``POST /emails/reply/TRACKING_HASH`` -Tracking hash is created as unique hash for each email send stat record. +Tracking hash is created as unique hash for each Email send stat record. .. _response-7: From 55b12b70dde87ca4f07cd9a1024b8c466f350dd0 Mon Sep 17 00:00:00 2001 From: Abhisek Mazumdar Date: Wed, 11 Sep 2024 17:39:19 +0530 Subject: [PATCH 4/4] Add grapesjsbuilder docs & other fixes. --- docs/rest_api/emails.rst | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/docs/rest_api/emails.rst b/docs/rest_api/emails.rst index 5013e769..806c6064 100644 --- a/docs/rest_api/emails.rst +++ b/docs/rest_api/emails.rst @@ -1,7 +1,7 @@ Emails ###### -Use this endpoint to obtain details, create, update, or delete Mautic’s +Use this endpoint to obtain details, create, update, or delete Mautic's Emails. .. code-block:: php @@ -144,13 +144,13 @@ See JSON code example. | | | different than the one in the Mautic | | | | configuration | +----------------------+--------------+----------------------------------------+ -| ``isPublished`` | boolean | Published state | +| ``isPublished`` | boolean | Available for use state | +----------------------+--------------+----------------------------------------+ | ``publishUp`` | datetime/null| Date/time when the Email should be | -| | | published | +| | | available | +----------------------+--------------+----------------------------------------+ -| ``publishDown`` | datetime/null| Date/time the Email should be un | -| | | published | +| ``publishDown`` | datetime/null| Date/time the Email should be | +| | | unavailable | +----------------------+--------------+----------------------------------------+ | ``dateAdded`` | datetime | Date/time Email was created | +----------------------+--------------+----------------------------------------+ @@ -225,6 +225,9 @@ See JSON code example. | ``assetAttachments`` | array | asset IDs Array for Email attachment | | | | | +----------------------+--------------+----------------------------------------+ +| ``grapesjsbuilder`` | array | ``customMjml`` key along with MJML | +| | | content for email based on MJML. | ++----------------------+--------------+----------------------------------------+ List Emails ~~~~~~~~~~~ @@ -337,7 +340,7 @@ HTTP request +------------------+---------------------------------------------------+ | ``orderByDir`` | Sort direction: asc or desc. | +------------------+---------------------------------------------------+ -| ``publishedOnly``| Only return currently published entities. | +| ``publishedOnly``| Only return currently available entities. | +------------------+---------------------------------------------------+ | ``minimal`` | Return only array of entities without additional | | | lists in it. | @@ -406,13 +409,13 @@ HTTP request | | | different than the one in the Mautic | | | | configuration | +----------------------+--------------+----------------------------------------+ -| ``isPublished`` | boolean | Published state | +| ``isPublished`` | boolean | Available state | +----------------------+--------------+----------------------------------------+ | ``publishUp`` | datetime/null| Date/time when the Email should be | -| | | published | +| | | available | +----------------------+--------------+----------------------------------------+ -| ``publishDown`` | datetime/null| Date/time the Email should be un | -| | | published | +| ``publishDown`` | datetime/null| Date/time the Email should be | +| | | unavailable | +----------------------+--------------+----------------------------------------+ | ``language`` | string | Language locale of the Email | +----------------------+--------------+----------------------------------------+ @@ -471,6 +474,9 @@ HTTP request | ``assetAttachments`` | array | asset IDs Array for Email attachment | | | | | +----------------------+--------------+----------------------------------------+ +| ``grapesjsbuilder`` | array | ``customMjml`` key along with MJML | +| | | content for email based on MJML. | ++----------------------+--------------+----------------------------------------+ .. _response-2: @@ -548,13 +554,13 @@ To edit a Email and create a new one if the Email is not found: | | | different than the one in the Mautic | | | | configuration | +------------------------+--------------+----------------------------------------+ -| ``isPublished`` | boolean | Published state | +| ``isPublished`` | boolean | Available state | +------------------------+--------------+----------------------------------------+ | ``publishUp`` | datetime/null| Date/time when the Email should be | -| | | published | +| | | available | +------------------------+--------------+----------------------------------------+ -| ``publishDown`` | datetime/null| Date/time the Email should be un | -| | | published | +| ``publishDown`` | datetime/null| Date/time the Email should be | +| | | unavailable | +------------------------+--------------+----------------------------------------+ | ``language`` | string | Language locale of the Email | +------------------------+--------------+----------------------------------------+