1. What this module does
A birthday greeting with a small gift is one of the few marketing e-mails customers are glad to receive. The module sends every customer who gave their birth date a personal discount code for their birthday — for example 15% off, valid for 14 days — by e-mail in their language, once a year. The code is a standard PrestaShop voucher that only that customer can use, and they also find it under Vouchers in their account.
You choose the discount (a percentage, a fixed amount or free shipping), how long it is valid, a minimum cart, how many days before the birthday it is sent, and who gets it (all customers, newsletter subscribers only, customers who have ordered before).
Works with PrestaShop 1.7.8, 8.x and 9.x (PHP 7.2.5 or newer), with the Classic and Hummingbird themes and with multistore.
2. Installation
- Download the module from My account → Order history at addonspresta.com.
- In your Back Office, open Modules → Module Manager and click Upload a module.
- Drop the
ap_birthdaycoupon_v1.0.0.zipfile and wait for the confirmation. - Click Configure on the module card.
The module works right after installation: on their birthday customers get a 15% code valid for 14 days, sent with the first visit of the day in your shop. Check the Birth dates and daily run panel: if PrestaShop does not ask for the birth date yet, click Switch the birth date field on.
3. How it works
PrestaShop asks customers for their birth date in the registration form and in their account when Shop Parameters
→ Customer Settings → Ask for birth date is on. Once a day the module looks for the customers of each shop whose
birthday is today (or in the chosen number of days), and for each of them creates a code — a voucher in Catalog →
Discounts with the description ap_birthdaycoupon <year>, restricted to the customer, usable once, highlighted in
the cart — and sends the birthday e-mail.
- Once a year. A customer gets one code per birthday, however often the daily run is started.
- Customers with an account, active, with a valid e-mail. Guests are not included.
- 29 February. Customers born on 29 February get their code on 28 February in other years.
- Valid from the birthday for the chosen number of days, until the end of the last day. A code sent a few days in advance is valid from the day it is sent.
The daily run starts in one of three ways:
- A cron job (recommended): your server calls the address shown in the panel once a day, at the time you choose.
- The first visit of the day: when no cron job runs, the first visitor of the day starts it (on by default).
- Send today's codes now in the panel.
A run started by the cron job or the button sends at most 200 codes, a run started by a visit at most 25; the next run continues with the rest. The module does not connect to addonspresta.com or any other server and sets no cookies.
4. Features and settings
Open Modules → Module Manager → Birthday Coupon → Configure. The Help box at the top links to this manual and to the module page at addonspresta.com, in the language of your Back Office.
Birth dates and daily run
- A warning and the button Switch the birth date field on when PrestaShop does not ask for the birth date in a shop of the current selection.
- For each shop: how many customers gave their birth date and when the daily run last finished.
- The cron job with its address. Keep the address secret: it contains a token, and anyone who knows it can start the daily run (they cannot do anything else with it).
- Send today's codes now — starts the daily run of the shops selected in the header. Customers who already have this year's code get nothing more.
Birthday codes
- Send birthday codes — switch the module off without losing the settings; codes already sent keep working.
- Send the code … days before the birthday — 0 sends it on the birthday, up to 30 days earlier.
- Only customers subscribed to the newsletter — a birthday e-mail with an offer is marketing. In the EU send it only to customers who agreed to it, for example when they subscribed to the newsletter.
- Only customers who have ordered before — customers with at least one paid order.
- Run with the first visit of the day — for shops without a cron job. With a cron job you can switch it off.
Discount
- Discount type — Percentage of the products, Fixed amount or Free shipping.
- Discount value — a percentage from 0.01 to 100, or an amount with tax in the default currency; not used for free shipping.
- Valid for — from 1 to 365 days, counted from the birthday.
- Minimum cart total to use the code — tax included; 0 means no minimum.
- Not on products already on sale — the discount ignores products with a specific price or a catalog price rule.
- Can be combined with other vouchers — when off, the code cannot be used together with another voucher.
- Voucher name — per language, shown in the cart and under Vouchers. Default "Happy birthday!".
- Code prefix — up to 10 letters, digits or hyphens before 8 random characters, for example
BDAY-7KQ2M9XA.
Changes apply to the codes sent afterwards. To change a code already sent, edit it in Catalog → Discounts.
Issued codes
The last 50 codes of the shops selected in the header: date, customer, birthday (day and month), code, discount, valid until, status — Unused, Used, Expired or Deleted — and whether the e-mail was sent.
5. Multistore
The settings are saved for the shop or shop group selected in the Back Office header. Select All shops to use the same rules everywhere, or one shop to give it its own discount and texts. Each customer gets the code of the shop where they registered, valid in that shop only. The cron address runs every shop. In the All shops or group context only an employee who manages every shop of that context can save or switch the birth date field on. One licence covers all shops of the installation.
6. Uninstall
Module Manager → Birthday Coupon → Uninstall deletes the module's settings and its list of issued codes. The codes themselves stay in Catalog → Discounts and keep working until they expire. The birth date field of PrestaShop stays as it is. To keep the settings, use Disable instead. Remove the cron job from your server too.
7. FAQ and troubleshooting
No code was sent today. Check in the Birth dates and daily run panel that the birth date field is on, that customers have a birth date and when the last run finished. The customer must have an account, be active and match the options (newsletter, earlier orders). Without a cron job, the run starts with the first visit of the day; press Send today's codes now to start it at once.
The customer did not receive the e-mail. Check the shop's mail settings in Advanced Parameters → E-mail (the test e-mail there). The Issued codes panel shows whether the e-mail was sent. The code is also under Vouchers in the customer account.
How do I set up the cron job?
In your hosting panel, add a task that calls the address from the panel once a day, for example
curl -fsS "https://your-shop.com/module/ap_birthdaycoupon/cron?token=…" at 8:00. Then you may switch off Run with
the first visit of the day.
The code is refused in the cart. The customer must be logged in to the account the code belongs to, the cart must reach the minimum total and the code must not be expired or used. With Not on products already on sale, a cart with only discounted products gets no discount; without Can be combined with other vouchers, remove the other voucher first.
Can someone create several accounts to collect codes? Each account gets at most one code a year, but a new account with a birthday tomorrow gets one too. If that is a risk for your shop, switch on Only customers who have ordered before.
Can I change the e-mail?
Copy mails/<language>/ap_birthdaycoupon.html and .txt from the module to
themes/<your-theme>/modules/ap_birthdaycoupon/mails/<language>/ and edit the copies.
A text stays in English in my Polish or French shop. Fill in the voucher name of that language in the module's configuration. The other texts are translated in International → Translations → Translations of installed modules.
8. Updates and support
Updates are free for life: download new versions from My account → Order history at addonspresta.com and upload them like a new module. Your settings are kept.
Support is included for 12 months from your order: write to mail@addonspresta.com or use the contact form at addonspresta.com (Monday to Friday, 10:00–16:00 CET; we usually answer within 2 business days). Please include your PrestaShop version, the module version and the steps that lead to the problem.