Custom Variables
Custom variables let you define reusable placeholders — like your bank account number, IBAN, or support phone — once, and insert them into any reminder email by typing {variable_name}.
Available since v1.2.0
Overview
Every payment reminder needs to tell your customers where to send their payment. Typing your bank details by hand into each email message is tedious and error-prone. If your account number changes, you would need to update every message individually.
Custom variables solve this problem. You define a named placeholder once — for example account_number — and then write {account_number} anywhere in an email subject or body. When the module sends a reminder, it replaces the placeholder with the real value automatically.
There are two types of variable. Static Value stores a fixed piece of text you supply directly. Configuration Key reads its value live from a PrestaShop configuration key, which is useful when a value is already stored in PrestaShop and you want your emails to stay in sync automatically without maintaining two copies of the same information.
Variables are scoped to your shop. In a multi-shop setup, each shop maintains its own variable list, so you can have different bank accounts or contact details per shop.
Configuration
Add a Variable
- Go to Modules > Module Manager, find Order Payment Reminders Pro, and click Configure.
- Scroll to the Custom Variables section on the main dashboard page (below the setup checklist).
- Fill in the Add New Variable form at the bottom of the panel:
| Field | Required | Description |
|---|---|---|
| Variable Name | Yes | A short identifier using only letters, numbers, and underscores. Must start with a letter or underscore. Examples: account_number, bank_address, support_phone. Maximum 64 characters. |
| Type | Yes | Static Value — store the text directly. Configuration Key — read the value from a PrestaShop configuration key each time an email is sent. |
| Value | Yes | For Static Value: the text to insert (max 255 characters, HTML stripped). For Configuration Key: the uppercase config key name, e.g. PS_SHOP_EMAIL. |
- Click Add.
The table refreshes immediately and your new variable appears. The Preview column shows the resolved value so you can confirm it looks correct.
Variable names are case-sensitive in templates. A variable named
account_numbermust be written as{account_number}— not{Account_Number}or{ACCOUNT_NUMBER}.
Edit a Variable
- In the Custom Variables table, click the pencil (edit) icon on the row you want to change.
- Update the name, type, or value as needed.
- Click Save.
If you change a variable's name after it has been used in messages, the old placeholder will no longer be replaced. Update the message bodies first, then rename the variable.
Delete a Variable
- In the Custom Variables table, click the red trash icon on the row you want to remove.
- Confirm the deletion.
Deletion is immediate and permanent. Any {variable_name} placeholders already written into your message templates will be left as literal text in emails. Remove them from your messages before deleting a variable.
Use a Variable in an Email
- Open the reminder message you want to edit (in the Messages section of the module configuration).
- In the Subject or Message body, type
{variable_name}at the exact point where you want the value to appear. - Save the message.
When the cron job runs, every {variable_name} placeholder is replaced with its resolved value before the email is delivered to the customer. You can combine custom variables with the built-in variables ({totalamount}, {completename}, {daysleft}, etc.) freely in both the subject and the body.
How It Works
When your cron job runs and a reminder is due, the module fetches all custom variables defined for that shop. For each Static Value variable, it uses the text you saved. For each Configuration Key variable, it reads the current value from PrestaShop's configuration table at that moment — so if the underlying setting changed since you last saved the variable, the email uses the updated value automatically.
After collecting all resolved values, the module performs a single pass over both the email subject and body, replacing every {variable_name} pattern it finds. Placeholders that have no matching variable are left as-is, appearing as literal text in the delivered email.
Static Value Variables
When you choose Static Value, the text you enter is stored directly and used verbatim in every email. HTML tags are stripped automatically when you save, so the value is always plain text. This is the right choice for payment details, IBAN numbers, BIC codes, bank names, and any other text that you control and update manually.
Configuration Key Variables
When you choose Configuration Key, you enter the name of a PrestaShop configuration key in uppercase (for example PS_SHOP_NAME or PS_SHOP_EMAIL). When you leave the field, the module immediately validates the key and shows a preview of its current value. If the key is not found, you will see a red "Not found" notice.
At email send time, the value is read live from the configuration table, so your reminders automatically reflect any change to the underlying PrestaShop setting. This is the right choice for any value that is already stored and maintained elsewhere in your store — your store name, phone number, or a value set by another installed module.
Only plain string or numeric configuration values are supported. Configuration keys that hold complex data (JSON arrays or objects) are rejected.
Usage Examples
Example: Bank transfer instructions
A store using bank wire wants every reminder to include its payment details. Create three variables:
| Variable Name | Type | Value |
|---|---|---|
iban | Static Value | DE89 3704 0044 0532 0130 00 |
bic | Static Value | COBADEFFXXX |
bank_name | Static Value | Commerzbank AG |
In the message body, write:
Please transfer the outstanding amount of {totalamount} to:
Bank: {bank_name}
IBAN: {iban}
BIC/SWIFT: {bic}
Reference: Order #{reference}
Payment must be received within {daysleft} days.
If your bank details ever change, update the three variables once and every future reminder reflects the change immediately.
Example: Customer support phone using a PrestaShop config key
Your phone number is already set in Shop Parameters > Contact. Rather than duplicating it, create one variable:
| Variable Name | Type | Value |
|---|---|---|
support_phone | Configuration Key | PS_SHOP_PHONE |
Then insert {support_phone} in your message footer: "Questions? Call us at {support_phone}." If you ever update the phone number in PrestaShop's shop parameters, every future reminder picks up the new number automatically — no further action needed.
Example: Payment portal link
Your store provides a hosted payment page where customers can complete payment online. Store the URL once:
| Variable Name | Type | Value |
|---|---|---|
payment_portal_url | Static Value | https://pay.yourstore.com/complete |
In your reminder subject: "Complete your payment at {payment_portal_url}". All reminder messages across all your payment methods will include the same up-to-date URL.
Important Notes
- HTML is not allowed in variable values. Any HTML tags in a Static Value are stripped automatically when you save. If you need a clickable link in an email, write the
<a>tag directly in the message body and use a variable for just the URL portion. - Variable names are unique per shop. You cannot have two variables with the same name in the same shop. Attempting to save a duplicate name returns an error.
- Configuration Key variables are validated on entry. If the key does not exist or holds a complex value (array or object), the module rejects it with a clear error message.
- Multi-shop: Each shop has its own independent variable list. Switching shops in the Back Office shows that shop's variables only. Variables are not shared across shops.
- Variables with no resolved value are silently skipped. If a Configuration Key is later removed from PrestaShop, the placeholder will appear as literal text in emails rather than inserting a blank. Remove obsolete placeholders from your message templates if you delete the underlying configuration key.
- Variable names are case-sensitive.
{iban}and{IBAN}are treated as different placeholders.
Troubleshooting
| Problem | Solution |
|---|---|
{variable_name} appears as literal text in the sent email | The name in the email template does not exactly match the variable name in the table. Check for typos, capital letters, or spaces. Variable names are case-sensitive. |
| "Variable name can only contain letters, numbers, and underscores" error | The name you entered contains a space, dash, or special character. Use underscores instead (e.g. bank_address not bank address). |
| Configuration Key shows "Not found" in preview | The key you entered does not exist in PrestaShop's configuration table. Double-check the spelling and ensure the module that creates this key is installed and has been configured at least once. |
| Configuration Key shows "Configuration value is not a simple type" | The key holds a JSON array or object (e.g. a payment module storing complex configuration). Only plain string or number values are supported. Use a Static Value variable instead and update it manually. |
| Deleted a variable, now emails show the raw placeholder | You deleted a variable that is still referenced in a message template. Edit the affected messages and remove or replace the {variable_name} placeholder. |
| Variable value changed but emails still show the old value | For Static variables, open the variable and save it again with the new value. For Configuration Key variables, confirm the underlying PrestaShop configuration was actually updated and saved. |
| Duplicate name error when saving | Each variable name must be unique within the same shop. Choose a different name or edit the existing variable instead. |
Frequently Asked Questions
How many custom variables can I create?
There is no fixed limit. You can create as many variables as your store needs.
Can I use a custom variable in the email subject line as well as the body?
Yes. Custom variables are replaced in both the subject and the body of every reminder email before it is delivered.
What happens if I use {account_number} in a message but have not created that variable yet?
The placeholder is left as literal text in the sent email — your customer will see {account_number} in the message. Always verify your variables exist and preview as expected before activating a message.
Can I store multi-line text like a full postal address in a variable?
No. Variable values are plain text stored in a single-line field (maximum 255 characters). For multi-line content such as a full mailing address, write it directly into the message body using the rich text editor.
Does a Configuration Key variable update automatically when the PrestaShop setting changes?
Yes. The value is read from the configuration table each time the cron runs and sends an email, so any change to the underlying PrestaShop setting takes effect on the next reminder run with no action required from you.
Can I use the same variable in multiple reminder messages?
Yes. A variable defined once is available in every reminder message for that shop. Insert {variable_name} in as many messages as you need.
What is the difference between Custom Variables and the built-in variables like {totalamount}?
Built-in variables are populated automatically from live order data — customer name, order total, days remaining, and so on. Custom variables are pieces of text you define yourself, typically store-specific information like payment details or contact info that does not come from an individual order.
Are custom variables substituted in Test Mode emails?
Yes. When you send a test email from the Test Mode section, custom variables are resolved and substituted exactly as they would be in a live reminder.
What happens if a Configuration Key I used gets uninstalled or removed?
The variable will still exist in your list, but the placeholder will appear as literal text in sent emails because the key no longer exists. Remove or replace the placeholder in your message templates, then delete the variable from the list to keep things tidy.