LogoLogo
WordPress.orgExtensionsSupport
Version 9
Version 9
  • Notification – Custom Notifications and Alerts for WordPress
  • Updating to v9
  • Known issues
  • πŸ€Έβ€β™€οΈ User guide
    • Update broke my site
    • How Notification plugin works
    • Who can use this plugin
    • How to create Notifications
    • Troubleshooting
    • Advanced
      • How to escape { character
      • Background processing
      • How to setup different FROM address for different Notifications
      • Custom Post Type support
      • Disable upselling
      • How to send HTML Emails
  • πŸ”§Developer
    • General
      • Plugin loading chain
      • Runtime
      • Extension possibilities
      • Creating an extension
      • Customizations
      • Bundling Notification plugin
      • White label mode
    • Notifications
      • Suppressing the Notification
      • JSON synchronization
      • Programmatic Notifications
    • Triggers
      • List of all default Triggers
      • Custom Trigger
      • Enable support for non-public Custom Post Type
      • Adding Merge Tags to existing Triggers
    • Carriers
      • Custom Carrier
      • Adding custom fields to Carrier form
      • Suppressing the Carrier
    • Recipients
      • Custom Recipient
    • Snippets
      • General
        • Automatic Trigger testing
        • Allow other roles to edit Notifications
        • Programmatic Notification with manual Trigger
        • Background Processing filter
      • Triggers
        • Post
        • User
      • Integations
        • WP All Import
        • MemberPress
  • 🧩Extensions
    • Installation
    • Planned extensions
    • 3rd Party Extensions
    • Custom Fields
      • v2.2
      • v1.4
      • v1.3
    • Conditionals
    • Email Attachments
    • Push
    • Scheduled Triggers
    • Slack
    • Twilio
    • Webhooks
Powered by GitBook
On this page
  • Default usage
  • Custom notifications directory

Was this helpful?

  1. Developer
  2. Notifications

JSON synchronization

Synchronize all the Notifications by saving them within the theme or plugin files.

This is very similar to how Advanced Custom Fields JSON synchronization works. Whenever you save the notification in wp-admin the JSON file with all the config is saved within the directory you specified. It works the other way around as well - if you don't have the notification in your WordPress database, you can pull it from the file.

The notification is sent even if it's just in the file and not in the database, so you can import it just for editing purposes.

Default usage

use BracketSpace\Notification\Core\Sync;

add_action('notification/init', function () {
	Sync::enable();
}, 5);

You can put this code in your custom plugin or your child theme's functions.php file.

By default, all the notifications will be saved within the wp-content/themes/$theme/notifications/ directory.

Custom notifications directory

You can put the notifications in a custom directory if you like, just pass the full path in the parameter.

To put the notifications within the wp-content/uploads directory do it like this:

use BracketSpace\Notification\Core\Sync;

add_action('notification/init', function () {
    $uploadsDir = wp_upload_dir();
    Sync::enable($uploadsDir['basedir']);
}, 5);

The Notification plugin supports only one synchronization directory

PreviousSuppressing the NotificationNextProgrammatic Notifications

Last updated 6 months ago

Was this helpful?

πŸ”§