Templates

This section shows the available routes related to AcyMailing templates

Get one template

GET https://www.example.com/index.php?page=acymailing_front&option=com_acym&ctrl=api&task=getOneTemplate&templateId={id}

Get one template by ID

Query Parameters

Name
Type
Description

templateId*

Int

ID of the template to get

Headers

Name
Type
Description

Api-Key*

String

The API key of a valid AcyMailing license used in the AcyMailing configuration page, tab "License".

[
    {
        "id": "84",
        "name": "Test template",
        "creation_date": "2024-01-17 15:33:41",
        "drag_editor": "0",
        "body": "<div>Hello,</div><br /><div>This is a test for a simple template.</div>",
        "subject": "Test subject",
        "from_name": "Example",
        "from_email": "info@example.com",
        "reply_to_name": "John Doe",
        "reply_to_email": "john@example.com",
        "settings": "",
        "stylesheet": "div {font-size: 14px;}",
        "headers": "",
        "preheader": "Preview line to be seen in preview of mail content"
    }
]

Get templates

GET https://www.example.com/index.php?page=acymailing_front&option=com_acym&ctrl=api&task=getTemplates

Get a collection of templates

Query Parameters

Name
Type
Description

filters

Array

You can filter templates searching a text in their name/subject, or specifying the type of template ("drag" for drag and drop templates, "standard" for others, leave empty for both). Example:

[

"search": "New Year",

"templateType": "standard"

]

templateType

String

Type of template to get if you want only templates for standard editor (value: standard) or for drag and drop templates (value: drag). Don't use this parameter if you want all types.

limit

Int

The number of templates you would like to get in your request, by default it's set to 20

offset

Int

From which element in the database you would like to start getting templates, by default it's set to 0

Headers

Name
Type
Description

Api-Key*

String

The API key of a valid AcyMailing license used in the AcyMailing configuration page, tab "License".

[
    {
        "id": "84",
        "name": "Test template",
        "creation_date": "2024-01-15 15:33:41",
        "drag_editor": "0",
        "body": "<div>Hello,</div><br /><div>This is a test for a simple template.</div>",
        "subject": "Test subject",
        "from_name": "Example",
        "from_email": "info@example.com",
        "reply_to_name": "John Doe",
        "reply_to_email": "john@example.com",
        "settings": "",
        "stylesheet": "div {font-size: 14px;}",
        "headers": "",
        "preheader": "Preview line to be seen in preview of mail content"
    },
    {
        "id": "85",
        "name": "Test template 2",
        "creation_date": "2024-01-17 15:33:41",
        "drag_editor": "1",
        "body": "<div id=\"acym__wysid__template\" class=\"cell\">...</div>",
        "from_name": "Example",
        "from_email": "info@example.com",
        "reply_to_name": "John Doe",
        "reply_to_email": "john@example.com",
        "settings": "",
        "stylesheet": "div {font-size: 14px;}",
        "headers": "",
        "preheader": "Preview line to be seen in preview of mail content"
    }
]

Create a template

POST https://www.example.com/index.php?page=acymailing_front&option=com_acym&ctrl=api&task=createTemplate

Templates created like this can only be edited with the website editor and not the drag and drop one.

Headers

Name
Type
Description

Api-Key*

String

The API key of a valid AcyMailing license used in the AcyMailing configuration page, tab "License".

Content-Type*

String

application/json

Request Body

Name
Type
Description

name*

String

Name of the template

subject

String

Default subject of emails created using this template

body

String

HTML content of the email (only the body part)

from_name

String

Default from name for emails created using this template

from_email

String

Default from email address for emails created using this template

reply_to_name

String

Default reply-to name for emails created using this template

reply_to_email

String

Default reply-to email address for emails created using this template

headers

String

Extra headers to add to emails created using this template

preheader

String

Preview line displayed in mail clients for emails created using this template

stylesheet

String

CSS to be added to the email

The answers will contains the ID of the template created

{
    "templateId": 9
}

Modify a template

POST https://www.example.com/index.php?page=acymailing_front&option=com_acym&ctrl=api&task=updateTemplate

Modify an existing template

Headers

Name
Type
Description

Api-Key*

String

The API key of a valid AcyMailing license used in the AcyMailing configuration page, tab "License".

Content-Type*

String

application/json

Request Body

Name
Type
Description

templateId*

Int

ID of the template to modify

preheader

String

Preview line displayed in mail clients for emails created using this template

headers

String

Extra HTML headers to add to emails created using this template

reply_to_email

String

Default reply-to email address for emails created using this template

reply_to_name

String

Default reply-to name for emails created using this template

from_email

String

Default from email address for emails created using this template

from_name

String

Default from name for emails created using this template

body

String

HTML content of the email (only the body part)

subject

String

Default subject of emails created using this template

name

String

Name of the template

stylesheet

String

CSS to be added to the email

{
    "templateId": "85"
}

Delete a template

DELETE https://www.example.com/index.php?page=acymailing_front&option=com_acym&ctrl=api&task=deleteTemplate&templateId={id}

Query Parameters

Name
Type
Description

templateId*

Int

ID of the template to delete

Headers

Name
Type
Description

Api-Key*

String

The API key of a valid AcyMailing license used in the AcyMailing configuration page, tab "License".

{
    "message": "Template deleted."
}

Last updated