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

Offline fdangelo

  • Newbie
  • *
  • Posts: 17
  • Karma: +4/-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
  • Jr. Member
  • **
  • Posts: 73
  • Karma: +28/-1
    • 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
  • Jr. Member
  • **
  • Posts: 73
  • Karma: +28/-1
    • 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 »

Offline rollo202

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
    • viajes
Re: How to add customerid to email templates
« Reply #3 on: August 23, 2020, 02:12:00 PM »
I had the same question, thank you for answering

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 5774
  • Karma: +274/-2
    • View Profile

 

Powered by SMFPacks Social Login Mod