• I’m creating a WordPress site with a large number of authors. I’d like readers to be able to subscribe to certain categories and/or authors so they will receive a browser alert and/or email when new content is posted.

    The wrinkle is, I’d like readers to be able to choose for which categories or authors they’d like to receive the alerts/emails.

    I see plenty of options for newsletters, but nothing for specific, per-category or per-author alerts/emails chosen per reader. The large and fluctuating number of authors make setting up a special mailing list for each very impractical.

    Do you have any suggestions on how I can accomplish this or plug-ins that are available? I appreciate any help you can offer.

    • This topic was modified 6 years, 5 months ago by PrettyPixels.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    I’m unaware of such plugins, but it’s certainly worth a search before embarking on a custom coding project.

    User preference IDs can be stored in each author or category meta data. Thus each category or author has an array of user IDs that wish to get notifications. Hook one of the post update filters like “save_post”. In the added callback, get the user IDs from author meta and any category meta. Loop through the IDs. For each user ID, get the user’s email, then send them a message with wp_mail().

    Naturally you will need functions to add or remove preferences from meta data associated with any particular post. You could add code to your theme’s sidebar template that checks for user preference of the current post and displays either subscribe or unsubscribe links accordingly. The links can trigger Ajax calls to add or remove the user ID from related meta data.

    Thread Starter PrettyPixels

    (@prettypixels)

    Thank you so much, bcworkz! That’s extremely helpful!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Browser and email alerts’ is closed to new replies.