Page 1 of 1

HTML emails with info-page templates

Posted: Thu Mar 18, 2021 10:36 am
by alix32
Hi - I know it's possible to leverage the info-pages and hooks to build and trigger nicely designed html emails for each event (account creation, forgot password, order confirmation and other statuses, etc...). However, has anyone been able to accomplish this and would you be willing to share step by step instructions?

Thanks!

Re: HTML emails with info-page templates

Posted: Thu Mar 18, 2021 12:20 pm
by heatherbell
alix32 wrote: Thu Mar 18, 2021 10:36 am However, has anyone been able to accomplish this and would you be willing to share step by step instructions?
We have not done it and probably there are other ways of doing it but using /includes/modules/notifications/templates/tpl_n_checkout.php as an example of a file that contains what is sent and /templates/yourtemplate/includes/pages/conditions.php as an example of a file that outputs an info page, if you added (from conditions.php) the code that outputs the infopage, into tpl_n_checkout.php i.e.

Code: Select all

$page = info_pages::get_page(['p.slug' => 'conditions',
                              'pd.languages_id' => (int)$_SESSION['languages_id']]);
echo $page['pages_text'];
It would then send the text configured in that info page.
Have a play with that.
You can imagine that bit of code could be used in a module anywhere to show content from an info page.

Re: HTML emails with info-page templates

Posted: Thu Mar 18, 2021 2:05 pm
by alix32
Thanks a lot @heatherbell . I'll give that a swirl