Book Image

PrestaShop Module Development

By : Fabien Serny
Book Image

PrestaShop Module Development

By: Fabien Serny

Overview of this book

Table of Contents (19 chapters)
PrestaShop Module Development
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Associating an e-mail with an order state


First, we will create the e-mail templates. Create a mails directory in the views/templates/ directory of your module. Then, create a subdirectory for each language, in our case, only English. At the end, you should have this directory: views/templates/mails/en/.

In this directory, create two template files: mymodpayment.txt and mymodpayment.html (there is no naming convention, so you can change it if you want to). In PrestaShop, for each e-mail, you always have to create two templates: one without HTML (txt file) and one with HTML (html file). PrestaShop sends the two templates as one. It permits you to have something displayable even when HTML is not enabled on an e-mail reader.

In PrestaShop, e-mail templates are not Smarty templates; you can't make condition or loop in it, but you can have dynamic variables. However, unlink Smarty, in this case, a variable is between { } but without beginning with $. For example, in mymodpayment.txt, we will have...