Email Notifications

Get Started

WB Ad Manager Pro sends automated email notifications to keep advertisers, admins, and classified buyers informed about important events. The notification system is modular — each category of notifications only activates when its parent module (ad submissions, classifieds, wallet, campaigns) is enabled. You can configure which notifications are active and customize email subjects from the Pro Settings Emails tab.

Email notification settings showing enable/disable toggles for each notification category

Notification Categories

The plugin includes two notification classes that work together:

  • Email_Notifications (Modules/Notifications/) — General site notifications triggered by hooks like wbam_ad_submitted, wbam_classified_created, wbam_campaign_started, etc.
  • Advertiser_Email_Notifications (Modules/Advertisers/) — Advertiser-specific notifications for ad status changes, fund request outcomes, campaign events, and low balance warnings.

All Email Templates

Advertiser Account Notifications

Event Recipient Subject Hook
Account approved Advertiser “Your advertiser account has been approved!” wbam_advertiser_approved / wbam_advertiser_status_changed
Account rejected Advertiser “Your advertiser application status” wbam_advertiser_rejected
Account suspended Advertiser “Your advertiser account has been suspended” wbam_advertiser_status_changed
Account banned Advertiser “Your advertiser account has been terminated” wbam_advertiser_status_changed
Account reactivated Advertiser “Your advertiser account has been reactivated” wbam_advertiser_status_changed

Ad Submission Notifications

These notifications require the Ad Submissions module to be enabled.

Event Recipient Subject Hook
New ad submitted Admin “New ad submission requires review” wbam_ad_submitted
Ad approved Advertiser “Your ad has been approved” wbam_ad_approved
Ad rejected Advertiser “Your ad submission was not approved” wbam_ad_rejected
Changes requested Advertiser “Changes requested for your ad” wbam_ad_changes_requested
Ad paused Advertiser “Your ad has been paused” transition_post_status

Classified Notifications

These notifications require the Classifieds module to be enabled.

Event Recipient Subject Hook
New classified submitted Admin “New classified listing requires review” wbam_classified_created
Classified approved Advertiser “Your classified listing is now live” wbam_classified_approved
Classified rejected Advertiser “Your classified listing was not approved” wbam_classified_rejected
Listing expiring Advertiser “Your listing expires in X days” wbam_classified_expiring
New listing from followed seller Followers “Seller posted a new listing” wbam_classified_approved (priority 20)
Inquiry received Classified owner “New inquiry about: [listing title]” wbam_inquiry_created

Wallet & Payment Notifications

These notifications require the Wallet module to be enabled.

Event Recipient Subject Hook
Wallet credited Advertiser “Wallet funds added successfully” wbam_wallet_credited
Low balance warning Advertiser “Low balance warning” wbam_advertiser_balance_debited
Fund request approved Advertiser “Funds added: $X credited to your wallet” wbam_fund_request_approved
Fund request rejected Advertiser “Fund request update” wbam_fund_request_rejected

The low balance notification includes a 24-hour cooldown to prevent notification fatigue. The threshold amount is configurable via the low_balance_threshold setting (default: $10).

Campaign Notifications

These notifications require the Campaigns module to be enabled.

Event Recipient Subject Hook
Campaign started Advertiser “Your campaign is now active” wbam_campaign_started
Campaign completed Advertiser “Your campaign has completed” wbam_campaign_completed
Campaign budget low Advertiser “Campaign budget is running low” wbam_campaign_budget_low
Campaign budget depleted Advertiser “Campaign budget depleted: [name]” wbam_campaign_budget_depleted
Campaign ended Advertiser “Campaign completed: [name]” wbam_campaign_ended

Customizing Email Settings

Pro Settings > Emails Tab

Navigate to WB Ad Manager > Pro Settings > Emails to configure email notifications. The settings include:

  • Enable/disable notification types — Choose which notification categories are active (ad status, fund status, campaign status, low balance).
  • HTML email mode — Toggle between plain-text and HTML-formatted emails.
  • Notification preferences — Global controls that work alongside per-advertiser preferences.

Per-Advertiser Preferences

Advertisers can manage their own notification preferences from their portal dashboard settings. The should_notify() method checks both global settings and individual advertiser preferences before sending any email.

Email Content

Each notification uses a built-in default template. You can override any template by creating a matching PHP file in the templates/emails/ directory of the plugin. The template system checks for custom templates first:

templates/emails/
├── advertiser-approved.php
├── advertiser-rejected.php
├── admin-ad-submitted.php
├── ad-approved.php
├── ad-rejected.php
├── ad-changes-requested.php
├── classified-approved.php
├── classified-rejected.php
├── classified-expiring.php
├── follower-new-listing.php
├── inquiry-received.php
├── wallet-credited.php
├── wallet-low-balance.php
├── campaign-started.php
├── campaign-completed.php
└── campaign-budget-low.php

If no custom template file exists, the plugin falls back to a built-in plain-text template defined in the get_default_template() method.

Customizing Emails with Hooks

Filter Email Before Sending

Both notification classes provide a filter to modify any email before it is sent:

// General notifications
add_filter( 'wbam_email_before_send', function( $email ) {
    // Modify subject, message, headers, or recipient
    $email['subject'] = '[Custom Prefix] ' . $email['subject'];
    return $email;
} );

// Advertiser notifications
add_filter( 'wbam_email_notification', function( $email ) {
    // Add BCC to all advertiser emails
    $email['headers'][] = 'Bcc: notifications@yoursite.com';
    return $email;
} );

Customize Classified Expiring Email

// Change the heading text
add_filter( 'wbam_classified_expiring_email_heading', function( $heading, $classified, $days_left ) {
    return sprintf( 'Only %d days left for your listing!', $days_left );
}, 10, 3 );

// Add custom renewal benefits
add_filter( 'wbam_classified_expiring_email_benefits', function( $benefits, $classified ) {
    $benefits[] = 'Priority placement in search results';
    return $benefits;
}, 10, 2 );

Email Delivery

All emails are sent using WordPress wp_mail(), which means they work with any SMTP plugin or email service you have configured (WP Mail SMTP, Mailgun, Amazon SES, etc.). The default sender is the site name and admin email address:

From: {Site Name} <{admin_email}>
Content-Type: text/plain; charset=UTF-8

When HTML email mode is enabled in settings, the Content-Type header switches to text/html and message content is processed through wpautop() for automatic paragraph formatting.

Last updated: March 4, 2026