Emails
The emails endpoint
POST https://www.regpack.com/reg/api2/emails/The emails endpoint is used to build a project's email content: the categories that templates are grouped under, and the templates themselves (subject and HTML body).
Basic structure
Each call to the API requires action and a group_id.
Name | Type | Required | Description |
|---|---|---|---|
action | string | true | For emails, the only actions are create_category and create_template. |
group_id | integer | true | This designates which project the change should be applied to. API-id in the header must be part of the organization that owns the group. |
doc | JSON | true | This contains the parameters you would like to include in the request, formatted as JSON. |
Actions
Action | Description |
|---|---|
create_category | Create an email category—the folder templates are grouped under. |
create_template | Create an email template under a category (created with create_category) and push its subject and HTML body. You can let the system generate the template id, or supply your own. |
Example call
This call creates a category. See the action pages for the full parameter sets.
curl -X POST "https://www.regpack.com/reg/api2/emails/" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Api-Id: 15263" \
-H "Api-user: [email protected]" \
-H "Api-Token: cd2e514f-7gab-3cde-62fg-51abcd4e7362" \
-d '{
"action": "create_category",
"group_id": 100909072,
"doc": {
"cat_name": "Registration Emails"
}
}'Example response
{
"success": true,
"cat_id": "112481",
"existed": false
}