Implémentation of a new article alert system
For visitors who do not come to a site every day to see what is new, it is interesting to set up an alert system concerning the activities of a workshop like this for example, the "News" section which will be implemented one day, ask for their participation in a poll/survey or invite them to participate in an event concerning our interest in ProcessWire or maintain contact between the site and them.
Usually, I set up a system of more or less well integrated Newsletters on my sites and it turns out that with PW we have all the tools integrated but also know how to use them.
Advice was sought on the forums and here is the result of the participatory reflection.
https://processwire.com/talk/topic/29416-notification-de-nouvel-article/
Today, January 11, 2024, we start working on it. :)
Here is what came out of the first advice given by his oldest PW on the feasibility with this or that tool.
- Anyway, I recommend reading and studying all the articles by @Juergen about FrontendForms module so that you learn how to use it.
-
FrontendForms - A frontend form creation and validation module
-
Your experience with PHP but here is a good free series that I can recommend
https://www.youtube.com/playlist?list=PLr3d3QYzkw2xabQRUpcZ_IBk9W50M9pe-
The more "PHP OOP" you know, the easier your path will be. -
I don't know how to save the addresses on the page or elsewhere.
In the FrontendForms module support topic you can find examples of saving to pages, search for PHP variables called $p and others. The easiest way to save data is to save it on dedicated pages. By dedicated, I mean that you first configure your templates with their fields and then you can simply create new pages for your subscribers (using the PW API, of course).
Even if its Readme file seems difficult to understand at first, I can still recommend it @adrien The Page Field Select Creator module to configure your subscribers/subscriber relationship: https://processwire.com/talk/topic/4523 -page-field-select-creator/ This helps automate the manual setup of parent/child relationships, which is a common scenario, and a subscriber/subscriber relationship is exactly like that.
You can learn more (among other PW forum topics like @kongondo ( great article ) in this article where car/car brand or author-list/author is the same relationship: https://medium.com /@clsource/understanding-processwire-templates-fields-and-pages-201aecd0a1a4 #.m9yquavll
- Some additional pointers:
As other people have already pointed out, you can use the API to create new pages (let's call them subscriber) with a specific parent (let's call them subscribers) who will hold your email addresses. Don't forget to check European legislation and all that entails once you go into production. Here, FrontendForms or even FormBuilder are good places to start, but also take a look at LoginRegisterPro . Both are paid modules, but you get plenty of features in both cases. Both paid modules can also automatically handle automatic registration of new users into the database, just like FrontendForms. I still use custom forms and submission handlers, but then you have to do a lot more coding.
Additionally, let's say you want to notify any subscriber when a new post (let's call it post) has been published, you need a hook like Pages::saved(template=post) to check if a new publication has been saved, then send it. your notification email to all subscribers. A hint on how to decide if a page is new can be found here . -
If you want a free module for user registration, you can use LoginRegister . There are features to validate emails, manage forgotten passwords and much more.
For notifications, you can add a checkbox on the user template "registered to notifications" and check it when the user wants notifications, so you can find them later with $users->find('registeredToNotifications =1').
To create forms for free, you can use the InputfieldForm module , for example for the notification subscription form.
To send emails, you can use the PHP mail function , if your server is properly configured to send emails.
We therefore have a good inventory to start testing these tools and choosing the one that best fits the project .
To be continued...
To be continued...
Attention : Cet espace est un site d'apprentissage. Ne vous préoccupez pas des erreurs et dysfonctionnements temporaires sur ces pages. Nous sommes en train de faire des tests. :)