Author Topic: How to add customerid to email templates  (Read 133 times)

Offline fdangelo

  • Newbie
  • *
  • Posts: 16
  • Karma: +3/-1
    • View Profile
How to add customerid to email templates
« 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.

Offline dvagner

  • Core/UI Developer
  • Newbie
  • *
  • Posts: 34
  • Karma: +13/-0
    • View Profile
Re: How to add customerid to email templates
« Reply #1 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".


Offline dvagner

  • Core/UI Developer
  • Newbie
  • *
  • Posts: 34
  • Karma: +13/-0
    • View Profile
Re: How to add customerid to email templates
« Reply #2 on: June 01, 2020, 09:54:36 AM »
You can manually update AMail class from 1.2.17 branch
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');
        }
    }
« Last Edit: June 02, 2020, 02:01:22 AM by Basara »

 

Powered by SMFPacks Social Login Mod