Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.

whatwedo/wwd-comment-notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

WWD Comment Notifier

Developed with ♥ by whatwedo(https://whatwedo.ch) in Bern

Note: This plugin was initially written in 2019 and used on a production site for 6 years. The client doesn't need the functionality anymore, but we thought it could still be useful or an inspiration for some people.

We don't maintain this code for future changes, but it was working up the following system requirements as of May 2025:

  • WordPress 6.8
  • PHP 8.4

Config

The plugin is shipped without any option page in WordPress. To configure the plugin use the JSON file in the config folder. This is a stateful and developer friendly way to customize the plugin.

Copy the config file within the config directory and adjust the content for your preferences. Add the custom config to your theme and use the following hook to register it:

add_filter('wwdcn_config_path', function () {
    return get_template_directory() . '/config/custom-notifier-config.json';
});

Variables

Defined variables in JSON file are not optional.

  1. name (string)
  2. mail (object)
  3. subject (string)
  4. content (string: Multilines are solved with an array structure [])
  5. from_address (string)
  6. excerpt_length (int)
  7. checkbox (object)
  8. label (sting)
  9. default_state (int)
  10. unsubscribe (object)
  11. title (string)
  12. text (string)
  13. url (string: / = homepage, false = subscriped post url)
  14. redirect_url (bol/string: false = dies and then redirects, set custom url here if you want to handle it differently)
  15. redirect_time (bol/string: just works when redirect_url is set to false)

Placeholders

Inside the mail content there are some magic placeholders available which will be turned into a dynamic value.

General placeholders:

  • {post_name}: The title of the post
  • {post_link}: The link to the post
  • {post_author}: The name of the author which wrote the post
  • {comment_excerpt}: An excerpt with the specified excerpt_length of the comment
  • {comment_link}: Specific link to the comment of the post
  • {comment_time}: The time of the comment (date + time) in ...
  • {comment_author}: The author of the comment

Personalized placeholders:

  • {name}: Name of the subscriber
  • {unsubscribe_link}: The link to unsubscribe from current post

About

Very simple subscribe to Comments and get notified. Nothing more.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages