2

I am thinking about a possibility to let members subscribe to a blog entry, and then get notified in case of new comments related to the respective entry. The comments are stored as entries in a Craft CMS channel.

My idea is to use the Like for Craft CMS plugin for the subscription to a blog entry. In a second step I would try to use the Postmaster for Craft CMS plugin to notify the subscribers by email. I hope that this will be possible using the Postmaster Developer API, but I am not sure.

What is your opinion regarding my idea? Do you know perhaps an easier approach.

I very much appreciate your help, thanks!

3 Answers 3

3

I really like the idea of using a simple plugin like Like to keep track of what entries users are interested in.

But instead of writing the code to integrate with Postmaster, I’d probably just use Craft’s API directly to send the mail after new entries are saved in your comments section.

The Like plugin and Craft API you need to look into:

1
  • You're right, I don't need the Postmaster plugin. Thank you!
    – MISC
    Commented Jul 23, 2016 at 20:21
2

Just wanted to give a short update on this project:

I was able to build this plugin. The only problem was, that sendEmailByKey() took a lot of time and delayed the saving process extremely (probably because of the slow sending by SMTP). So I've decided to replace SMTP by the Sparkpost API which allows to use templates in a similar way than sendEmailByKey. This solution is faster than the SMTP one. But I am afraid that with a bigger amount of followers the thing will become slow again.

In general, I am of the opinion, that doing email notification as part of the onSaveEntry event is probably not the best solution. Background tasks could be interesting, but I was not yet able to understand the Craft CMS TaskService ...

1
  • 1
    I don't suppose you can share the plugin? :-)
    – Ryan
    Commented Apr 5, 2017 at 3:53
2

Just a further update on this project:

I was now able to create a task for each notification email. This makes the onSaveEntry event much faster, because emails are now processed in the background. This makes it possible to use sendEmailByKey() instead of a third party API, which reduces the maintenance effort.

Creating tasks was much easier than expected (based on the PowerNap plugin).

1
  • Very good idea to use tasks, and I also agree with the sendEmailByKey decision!
    – carlcs
    Commented Aug 2, 2016 at 9:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.