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

Get PrestaShop Module Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.