Email Notifications
Every wallet event can fire an email. Built on the WooCommerce mailer — templates inherit your WC email styles automatically.
Setting up?
Skip to Notifications Settings for the per-event toggles, template editing, and admin digest setup.
Available Emails
| Event | Default | Recipient |
|---|---|---|
| Wallet credit | ON | customer |
| Wallet debit | ON | customer |
| Low-balance alert | ON | customer |
| Refund approved | ON | customer |
| Refund rejected | ON | customer |
| Withdrawal requested | ON | admin |
| Withdrawal approved | ON | customer |
| Withdrawal rejected | ON | customer |
| Withdrawal paid | ON | customer |
| Withdrawal failed | ON | admin |
| KYC submitted | ON | admin |
| KYC status changed | ON | customer |
| Transfer sent | ON | sender |
| Transfer received | ON | recipient |
| BNPL overdue | ON | customer (rate-limited 1/week per debt) |
| Top-up bonus credited | OFF | customer (optional confirmation) |
| Daily login reward | OFF | customer (usually too noisy to enable) |
Where to Toggle
Wallet → Settings → Notifications
Each row has:
- Enable toggle
- Subject (uses WC placeholders
{site_title},{customer_first_name}, etc.) - Heading (shown above the email body)
- Recipient override (admin emails only)
- HTML or plain picker
Editing Templates
Two ways:
Option A — WC Email Settings
Go to WooCommerce → Settings → Emails → each wallet email is listed there as a WKWP prefix. Use Manage to edit subject / heading / recipient and to enable per email.
Option B — Override Template Files
Copy wp-content/plugins/wallet-system/templates/emails/<email>.php to wp-content/themes/<your-theme>/wallet-system/emails/<email>.php. WC's template loader picks up the override.
Use the override path
Editing in-place inside the plugin folder gets wiped on update. Always override into the active theme.
Per-Email Templates
| Template | File |
|---|---|
| Wallet credit | templates/emails/wallet-credit.php |
| Wallet debit | templates/emails/wallet-debit.php |
| Low balance | templates/emails/low-balance.php |
| Refund approved | templates/emails/refund-approved.php |
| Refund rejected | templates/emails/refund-rejected.php |
| Withdrawal requested (admin) | templates/emails/withdrawal-requested-admin.php |
| Withdrawal approved | templates/emails/withdrawal-approved.php |
| Withdrawal rejected | templates/emails/withdrawal-rejected.php |
| Withdrawal paid | templates/emails/withdrawal-paid.php |
| KYC status changed | templates/emails/kyc-status-changed.php |
| Transfer sent | templates/emails/transfer-sent.php |
| Transfer received | templates/emails/transfer-received.php |
| BNPL overdue | templates/emails/bnpl-overdue.php |
Plain-text variants live alongside as <email>-plain.php.
Placeholders
Available across templates:
| Placeholder | Source |
|---|---|
{site_title} | get_bloginfo( 'name' ) |
{customer_first_name} | from user meta |
{customer_full_name} | from user meta |
{wallet_balance} | current _wkwc_wallet_amount formatted with WC currency |
{transaction_amount} | the credit / debit amount |
{transaction_type} | credit / debit / etc. |
{transaction_reference} | ledger reference |
{transaction_note} | ledger note |
{order_link} | URL to the customer's order |
{order_number} | WC order number |
{wallet_link} | URL to /my-account/my_wallet/ |
Per-event extras documented in each email's template header comment.
WPML Translation
All subjects + bodies are passed through WPML's string-translation registry. Translate strings in WPML → String Translation under context wkwp-wallet-emails.
Multilingual Trigger Language
Email is sent in the customer's preferred language:
- WPML user-language meta (
icl_admin_language_for_edit) - WC customer language (Polylang
pll_get_user_language) - Site default
Set in the order or fall through.
Suppression
| Suppression | How |
|---|---|
| Bulk operations | Toggle "Bulk suppress emails" on the Bulk page |
| Specific event | toggle off the row in Notifications |
| Per-customer opt-out | filter wkwp_email_recipients to drop the user from the list |
| Test mode | define( 'WKWP_DRY_RUN_EMAILS', true ); — emails go to admin email instead |
Hooks
| Hook | Type | When |
|---|---|---|
wkwp_email_recipients_<event> | filter | mutate the To list |
wkwp_email_subject_<event> | filter | mutate the subject |
wkwp_email_body_<event> | filter | mutate the rendered body |
wkwp_email_should_send | filter | global gate |
wkwp_email_sent_<event> | action | after wp_mail returns |
Daily Digest (admin)
Optional digest mailer — bundles the day's wallet activity into a single morning email to admin instead of N per-event emails.
| Setting | Default |
|---|---|
_wkwp_email_digest_enable | OFF |
_wkwp_email_digest_recipients | site admin email |
_wkwp_email_digest_send_time | 09:00 (server time) |
Digest contents:
- Total credited / debited yesterday
- New withdrawal requests
- New KYC submissions
- Approved / rejected counts
- Bulk batches completed
- BNPL new debt + overdue
Troubleshooting
| Problem | Fix |
|---|---|
| Emails not arriving | WC mailer not configured; install an SMTP plugin (WP Mail SMTP, FluentSMTP) |
| Email arriving but blank | Template override missing; revert to plugin template |
| HTML showing as plain text | Email enabled in plain mode — switch to HTML on the Notifications row |
| Wrong language | WPML user language meta missing; set in user profile |
| Customer never receives but admin does | Check spam; check that customer email is the right one in user meta |
