4th Step: Preparing Email templates

Top  Previous  Next

Email templates are just text files with specially formatted content. Generally, email has following required fields (rows in template): To, From, Subject and Message Body. However, other fields like BCC, Attachments etc. are also possible. Please refer to Email Sending Action article for more information. In email template it should look like this:

Email template:

 

To: recepient@somehost.com

From: sender@somehost.com

Subject: This is an email subject

 

Message Body Text in free form (Either plain text or HTML formatted text)

In order to use variables (fields) we need to put them in figure brackets with hash signs (#), just like in the previous step.

We want to have all form fields to be included in our email. So the email template that will be sent to us should look like this:

 

To: info@mydomain.com

From: {#email#}

Subject: Contact Form Filled

 

Information from the Contact form:

Full Name: {#name#}

Email: {#email#}

Phone: {#phone#}

 

Subject: {#subject#}

 

Comments:

{#comment#}

Email template “to us” saved as: email.txt
 
We create email template for the auto generated email to the form's submitter the same way:

 

To: {#email#}

From: info@mydomain.com

Subject: Thank you for contacting Mydomain.com

 

Dear {#name#},

 

You have submitted the following information to mydomain.com

---

Name: {#name#}

Email: {#email#}

Phone: {#phone#}

Subject: {#subject#}

 

Comments:

{#comment#}

---

 

Thank you for contacting us. We will respond as soon as possible!

 

Sincerely,

Mydomain.com Team

Email template “to client” saved as: autoresponder.txt