Setting up email templates

From DreamFactory
Jump to: navigation, search
DreamFactoryTutorialsSetting up email templates
(Created page with "### Tutorial DreamFactory supports email templates that you can use in your email sent out by the email services. You can setup email templates using the admin console as we...")
 
Line 1: Line 1:
### Tutorial
+
=== Tutorial ===
  
 
DreamFactory supports email templates that you can use in your email sent out by the email services. You can setup email  
 
DreamFactory supports email templates that you can use in your email sent out by the email services. You can setup email  
 
templates using the admin console as well as using API Endpoints.
 
templates using the admin console as well as using API Endpoints.
  
### Setup Email Templates using admin console.
+
=== Setup Email Templates using admin console. ===
  
 
Login to the admin console and click on the 'Config' tab. Click on 'Email Templates' from the left navigation menu. The  
 
Login to the admin console and click on the 'Config' tab. Click on 'Email Templates' from the left navigation menu. The  
Line 11: Line 11:
 
a new template. Fill in the template form and create your template.  
 
a new template. Fill in the template form and create your template.  
  
### API Endpoints
+
=== API Endpoints ===
  
#### Creating new Email Template
+
==== Creating new Email Template ====
  
 
<pre>POST http://{url}/api/v2/system/email_template</pre>
 
<pre>POST http://{url}/api/v2/system/email_template</pre>
Line 38: Line 38:
 
</source>
 
</source>
  
#### Editing an existing Email Template
+
==== Editing an existing Email Template ====
  
 
<pre>PATCH http://{url}/api/v2/system/email_template/{template_id}</pre>
 
<pre>PATCH http://{url}/api/v2/system/email_template/{template_id}</pre>
Line 59: Line 59:
 
</source>
 
</source>
  
### Example - Creating a new Email Template
+
=== Example - Creating a new Email Template ===
  
 
* Request Body:
 
* Request Body:
Line 85: Line 85:
 
<pre>POST http://foo.com/api/v2/system/email_template</pre>
 
<pre>POST http://foo.com/api/v2/system/email_template</pre>
  
### Example - Editing an existing Email Template
+
=== Example - Editing an existing Email Template ===
  
 
* ID of the template to edit: 1
 
* ID of the template to edit: 1
Line 108: Line 108:
 
<pre>PATCH http://foo.com/api/v2/system/email_template/1</pre>
 
<pre>PATCH http://foo.com/api/v2/system/email_template/1</pre>
  
### Example - Editing a single field of an existing Email Template
+
=== Example - Editing a single field of an existing Email Template ===
  
 
* ID of the template to edit: 1
 
* ID of the template to edit: 1

Revision as of 18:38, 3 February 2016

Tutorial

DreamFactory supports email templates that you can use in your email sent out by the email services. You can setup email templates using the admin console as well as using API Endpoints.

Setup Email Templates using admin console.

Login to the admin console and click on the 'Config' tab. Click on 'Email Templates' from the left navigation menu. The 'Email Templates Overview' form lets you create a new template as well as edit an existing template. You can edit an existing template by selecting it from the '-- Select Email Template --' drop down box. Or click on the [+] (plus) button to create a new template. Fill in the template form and create your template.

API Endpoints

Creating new Email Template

POST http://{url}/api/v2/system/email_template

Request Body:

{
    "resource":[
        {
			"name": "",
			"description": "",
			"to": "",
			"cc": "",
			"bcc": "",
			"subject": "",
			"body_text": "",
			"body_html": "",
			"from_name": "",
			"from_email": "",
			"reply_to_name": "",
			"reply_to_email": ""
		}
    ]
}

Editing an existing Email Template

PATCH http://{url}/api/v2/system/email_template/{template_id}

Request Body:

{
    "name": "",
    "description": "",
    "to": "",
    "cc": "",
    "bcc": "",
    "subject": "",
    "body_text": "",
    "body_html": "",
    "from_name": "",
    "from_email": "",
    "reply_to_name": "",
    "reply_to_email": ""
}

Example - Creating a new Email Template

  • Request Body:
{
    "resource":[
        {
            "name": "sales",
            "description": "An email template for sending out sales email.",
            "to": "jdoe@example.com",
            "cc": "adoe@example.com",
            "bcc": "bdoe@example.com",
            "subject": "Weekly sales report",
            "body_text": "Text body goes here",
            "body_html": "Html body goes here",
            "from_name": "Jane Doe",
            "from_email": "jane.doe@example.com",
            "reply_to_name": "Jane Doe",
            "reply_to_email": "jane.doe@example.com"
        }
    ]
}
  • Request URL:
POST http://foo.com/api/v2/system/email_template

Example - Editing an existing Email Template

  • ID of the template to edit: 1
  • Request Body:
{
    "name": "sales",
    "description": "An email template for sending out sales email.",
    "to": "jdoe@example.com",
    "cc": "adoe@example.com",
    "bcc": "bdoe@example.com",
    "subject": "Weekly sales report",
    "body_text": "Text body goes here",
    "body_html": "Html body goes here",
    "from_name": "Jane Doe",
    "from_email": "jane.doe@example.com",
    "reply_to_name": "Jane Doe",
    "reply_to_email": "jane.doe@example.com"
}
  • Request URL:
PATCH http://foo.com/api/v2/system/email_template/1

Example - Editing a single field of an existing Email Template

  • ID of the template to edit: 1
  • Field to edit: from_email
  • Request Body:
{
    "from_email": "jane.doe@example.com"
}
  • Request URL:
PATCH http://foo.com/api/v2/system/email_template/1