8000
Skip to content

logistiquetoulouse-del/prestashop-tsmailvars

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🇬🇧 English | 🇫🇷 Version française

tsmailvars

PrestaShop module that injects the product reference / combination reference into stock alert emails generated by the native ps_emailalerts module.

Compatible with PrestaShop 1.7.x and PrestaShop 8.x

Developed by Studio 109


Overview

The native PrestaShop module ps_emailalerts sends stock alert emails but does not include the product reference.

This module adds a new email variable: {product_reference}

allowing messages such as:

T-SHIRT BLUE (Reference: TS-BL-68) is almost out of stock.

instead of:

T-SHIRT BLUE is almost out of stock.


Features

  • adds {product_reference} variable to stock alert emails
  • supports product combinations
  • no core modification
  • no override
  • no modification of ps_emailalerts
  • compatible with PrestaShop 1.7 and 8
  • safe install / uninstall

How it works

The module uses two hooks.

actionUpdateQuantity

Triggered when product stock changes.

Stores temporarily:

  • id_product
  • id_product_attribute

sendMailAlterTemplateVars

Triggered just before email sending.

The module:

  1. checks if template = productoutofstock
  2. retrieves product reference
  3. injects {product_reference} into email template variables

Installation

Method 1 — Back Office

Upload the module ZIP via:

Modules → Module Manager → Upload a module

Method 2 — Manual installation

Upload folder:

/modules/tsmailvars/

Then install the module from the back office.


Important hook order

Check in:

Design → Positions

Hook:

actionUpdateQuantity

Order must be:

  1. tsmailvars
  2. ps_emailalerts

Email template modification

Add the reference in the stock alert email template:

{product} (Reference: {product_reference}) is almost out of stock.

Example paths:

themes/yourtheme/mails/fr/modules/ps_emailalerts/mails/fr/productoutofstock.html
themes/yourtheme/mails/fr/modules/ps_emailalerts/mails/fr/productoutofstock.txt


Example

Before:

T-SHIRT BLUE is almost out of stock.

After:

T-SHIRT BLUE (Reference: TS-BL-68) is almost out of stock.


Compatibility

Tested with:

  • PrestaShop 1.7.8
  • PrestaShop 8.x

Author

Studio 109

https://www.studio109prod.com
https://www.trophee-sportif.com


License

MIT

Releases

No releases published

Packages

 
 
 

Contributors

Languages

0