Problems, need help? Have a tip or advice? Post it here.
2 posts Page 1 of 1
Hello,

I'm currently developing a website using CouchCMS, where I have a News page and a News List managed through cloned pages.

I want to implement a feature that automatically sends email notifications to our subscribers whenever a new news article is published, either immediately upon creation or as a scheduled task using a cron job. The subscribers' email addresses are collected via a form on the website and stored within CouchCMS.

My questions are:

1. Does CouchCMS have built-in functionality to trigger these email notifications automatically upon publishing or via a cron job?

2. Is it possible to manage the list of subscribers from the CouchCMS admin panel, allowing the admin to view and possibly edit this list?

3. If CouchCMS does not support this natively, would I need to write custom PHP code to implement this feature, and if so, are there any recommended practices for integrating such a solution with CouchCMS?


Thank you for your assistance.

A.
Hello Ansh!

1. Does CouchCMS have built-in functionality to trigger these email notifications automatically upon publishing or via a cron job?

Yes, CouchCMS does have such a functionality using which you can trigger the email notification. You must have seen it too in the tutorials. The "Contact Form" uses a <cms:send_mail> tag. This can be used to achieve what you want. Though there will be some considerations. Also, You can create the alternative that you have in your mind, i.e. CRON Job. But there too you will need to use a CouchCMS managed template that will have the <cms:send_mail> tag used. Another important thing that needs to be noted here is that, every hosting has a capping on sending emails. So to handle the same, you can use the staggered approach explained in the "CSV Importer Module". Use case will depend on your requirement.

2. Is it possible to manage the list of subscribers from the CouchCMS admin panel, allowing the admin to view and possibly edit this list?

Yes, this can be done. There can be two approaches, but since you have mentioned the admin panel, i will try to give you a heads up on that. You can have an editable region, a checkbox, that is checked will allow a mail to be sent to that subscriber, else not. So everytime you post a news article and send a mail, the status of this editable can be checked for and accordingly mails can be sent.

3. If CouchCMS does not support this natively, would I need to write custom PHP code to implement this feature, and if so, are there any recommended practices for integrating such a solution with CouchCMS?

Now this is something that depends on your coding and comfort preference. CouchCMS does allow you to use native PHP code using the tag <cms:php>. As far as the recommended practices go, there are none. But if you want to use this feature in other projects that you develop, then you could write an Addon or Module for the same. You could search the forum for how to write one.

Feel free to ping us through DM or drop a message here to if you have any issues or questions.

Regards,
GXCPL (CTR)
Image
where innovation meets technology
2 posts Page 1 of 1