AbanteCart Community

Shopping Cart Operations => Tips and Tricks => Topic started by: fdangelo on May 31, 2020, 10:34:21 PM

Title: How to add customerid to email templates
Post by: fdangelo on May 31, 2020, 10:34:21 PM
I would like to add the customerid to all emails that are sent out.
I can't seem to figure out how to modify the template.

Any suggestions would be appreciated.
Thanks.
Title: Re: How to add customerid to email templates
Post by: dvagner on June 01, 2020, 01:54:16 AM
To add additional data to email template, you should:
1. Add to php code variables with needed data. (Hooks, direct change)
2. Add variables to "Allowed Placeholders".

Title: Re: How to add customerid to email templates
Post by: dvagner on June 01, 2020, 09:54:36 AM
You can manually update AMail class from 1.2.17 branch (https://github.com/abantecart/abantecart-src/blob/1.2.17/public_html/core/lib/mail.php)
and create hooks.
For example:
Code: [Select]
public function onAMail_ProcessData($method, $params)
    {
        $that = &$this->baseObject;
        if ($this->baseObject_method === 'setTemplate' && $params['text_id'] === 'admin_new_transaction_notify') {
            $that->setPlaceholder('user_id', 'Jon');
        }
    }
Title: Re: How to add customerid to email templates
Post by: rollo202 on August 23, 2020, 02:12:00 PM
I had the same question, thank you for answering
Title: Re: How to add customerid to email templates
Post by: Basara on August 24, 2020, 01:12:10 AM
The short dev manual with example
https://abantecart.atlassian.net/wiki/spaces/DOC/pages/1763835905/Extend+email+templates