Jump to content

passing an array of products to email template ps 1.7 and 1.6


avi_t

Recommended Posts

in my send function (mail)

 

 $products= $this->context->cart->getProducts();

$vars=[

   '{products}' =>$products

];

 return Mail::send(

    $idLang=1,

        $template="example",

        $subject="some thing",

        $templateVars= $vars  ,

        $to=$toe,

        null,

        null,

        null,

        null,

        null,

        _PS_MODULE_DIR_ . $this->name . '/mails/'

  );

 

in my mails directory =>en

i have example.html and example.txt

how can i loop throw the products? in thows files

i tried to add example.tpl but that not working

 

Edited by avi_t (see edit history)
Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...