Webjack Posted January 7 Share Posted January 7 Hello everyone ? I'm new to the Framework and don't really know how to code, but I usually get by with the tricks of an old brigand. I always come up with a result by modifying scripts and inventing happiness. But I've adopted Processwire precisely because it lets you build something with the tools it develops, and makes itself accessible to anyone who wants to learn to code. So I've [courageously] decided to stop integrating external elements into my sites (in principle) and to learn how to code them myself. So, I need a lead. ? I'm building a learning-by-doing site that's already starting to interest people of my ilk and, as it's written day by day, visitors have to come back to follow my stories. Of course, I have the means to graft a newsletter script or something similar onto my instance, but I want to do it with Processwire. On my own, it'll be months before I get there, but if you can help me out with some ideas, it might go faster. My idea is a button that visitors can press to sign up for update alerts, with of course the option of unsubscribing without any formality. The alternative idea is to install a clearly visible e-mail subscription box, but I don't know (yet) how this can be registered on the page so that I can retrieve them to send my alerts, which will include an unsubscribe link. I'll take care of the management until I become a programming kingpin. For the glory of humanity. ? Link to comment Share on other sites More sharing options...
szabesz Posted January 8 Share Posted January 8 Hello, Is there an exact question in your post I cannot find or you forgot to phrase it perhaps? Anyway, I recommend reading and studying all the posts of @Juergen's FrontendForms module so that you learn ho to use it. I hope this helps. Link to comment Share on other sites More sharing options...
Webjack Posted January 8 Author Share Posted January 8 Quote Is there an exact question in your post that I can't find or perhaps you forgot to word it? Thank you for your answer szabesz which is in line with what I am trying to do. I need a tool that is as simple as possible to set up and facilitate the action of the visitor who, with one click, will be able to subscribe to notifications which tell them that there is something new on the site. site. A new chapter to a story for example. Usually, I inserted an email box where the visitor registers but that was before because now, I want to create my tool with the possibilities that PW offers internally. This allows me to learn ProcessWire which is the primary purpose of the operation. For FrontendForms, I have already downloaded it and will install it tonight. But for my notifications I have to go through email, to collect registrations, a simple email field should do the trick, but I don't know how to save the addresses on the page or elsewhere. 1 Link to comment Share on other sites More sharing options...
szabesz Posted January 8 Share Posted January 8 (edited) 1 hour ago, Webjack said: Thank you for your answer szabesz which is in line with what I am trying to do. Glad to hear that. I do not know how much experience you have with PHP but here is a good and free series I can recommend: https://www.youtube.com/playlist?list=PLr3d3QYzkw2xabQRUpcZ_IBk9W50M9pe- As the more "OOP PHP" you know the easier your path will be. 1 hour ago, Webjack said: I don't know how to save the addresses on the page or elsewhere. In the FrontendForms module support topic you can find examples for saving to pages, look for PHP variables called $p and such. The easiest way to save any data is to save to dedicated pages. By dedicated, I mean that you first setup your templates with their fields and after that you can simply create new pages for your subscribers (by using the PW API, of course). While its readme sound hard to grasp at first, I can still recommend @adrian's Page Field Select Creator module to setup your subscribers/subscriber relationship: https://processwire.com/talk/topic/4523-page-field-select-creator/ What this does is that it automates the manual setup of parent/child relationships which is a common scenario and a subscribers/subscriber relationship is exactly like that. You can lear more about it (among other PW forum topics like @kongondo's excellent post) in this article where the car/car-brand or author-list/author is the same relationship: https://medium.com/@clsource/understanding-processwire-templates-fields-and-pages-201aecd0a1a4#.m9yquavll Edited January 8 by szabesz typo 1 Link to comment Share on other sites More sharing options...
Webjack Posted January 8 Author Share Posted January 8 (edited) Well, that’s a nice answer! ? For the videos, I don't understand English well enough to follow them but I know where to find excellent tutorials within my reach because if I have a few basics and understand how they work I never had the courage to do so. 'study in a good way. Now, at 72, it's a little late to get started, especially since I'm very busy with my passion. A big thank you of course because you understood my needs and gave more than just hints to get where I want to go. I will show you the results Edited January 8 by Webjack Forgot translate 1 Link to comment Share on other sites More sharing options...
szabesz Posted January 8 Share Posted January 8 16 minutes ago, Webjack said: Well, that's a nice answer! ? For the videos, I don't understand English well enough to follow them but I know where to find great tutorials within my reach because if I have some basics and understand how it works I never had the courage to study it the right way. Now, at 72, it's a bit late to start, especially as I'm very busy with my passion. A big thank you, of course, because you've understood my needs and given me more than enough clues to get where I want to go. I'll show you the results ? Happy to help! Please note that our forum rules https://processwire.com/talk/topic/8234-community-rules-guidelines/ state: "The forum language is English. We really appreciate the effort everyone makes from countries around the world to post in English. After careful consideration and experience on other forums, it makes sense to have one common language for discussion here so that ideas can be shared and not missed in language-specific forums - the same applies for debates that might get out of hand as we do not want to miss those either." So I translated your reply with deepl.com. You can do the same before you post or you can write in English in the first place and ask ChatGPT to "Please fix spelling and improve grammar: your text goes here". That way you can improve your English in the same time. The more you force yourself to use a language, the better you'll be at using it ;) Link to comment Share on other sites More sharing options...
Webjack Posted January 8 Author Share Posted January 8 I an sorry. ? Usualy, I translate before posting but this Time y forgot.il a mistaque. 1 Link to comment Share on other sites More sharing options...
poljpocket Posted January 8 Share Posted January 8 Hi Webjack ? Interesting project you have here! Some more 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 that subscribers) which will hold your email addresses. Don't forget to look at the EU law and whatever this entails once you go to production with this. Here, FrontendForms or also FormBuilder are good starting points, but also have a look at LoginRegisterPro. Both of them are paid modules, but you get a lot of functionality in either case. Both paid modules can also handle saving new users to the database automatically, just like FrontendForms. I am always using custom forms and submission handlers but then, you need to code a lot more. Further, say you want to notify any subscriber when a new article (let's call them post) has been published, you need a hook like Pages::saved(template=post) to check if a new post has been saved and then send out your notification email to all subscribers. A hint on how to decide if a page is new can be found here. Link to comment Share on other sites More sharing options...
Webjack Posted January 8 Author Share Posted January 8 Hello poljpocket, ? These are some interesting ideas that I'm going to look into while trying to respect my specifications, i.e. my timing, because as everything I'm discovering here is new, depending on the difficulty I'll have to prioritize. ProcessWire is so powerful! ? As for the API, I've already read about it and worked on it, and it's planned to tackle it after the emergencies, although from what I understand it's quite useful. But there are a couple of things to be done first, which are well under way. Let's say a good week. PRO modules Even though FormBuilder seems to be a must-have from what I've heard, it comes with a pretty hefty price tag (at least for me) and my sites aren't commercial, apart from the sale of a few manuals and tutorials I've written myself, but we're still in the amateur business. What's more, I'm not far enough advanced with PW to claim to be tackling too high a level, my vocation at the moment being to learn. I'm thinking, of course, of LoginRegisterPro, which in another context I'd have bought straight away ? As I'm still at the bottom of the ladder, I'll settle for something semi-automatic, processing publication alerts by hand to avoid my subscribers receiving too many and just what interests them. As far as legislation is concerned, I'm perfectly well informed, which is why I've been talking about "alerts" and not "newsletters" from the start, although they're practically the same thing ? Thank you all for giving me work. ? Link to comment Share on other sites More sharing options...
da² Posted January 9 Share Posted January 9 Hello, If you want a free module for user registration you can use LoginRegister. There's features to validate emails, manage forgotten passwords and more. For the notifications you can add a checkbox on user template "registered to notifications", and check it when user wants notifications, so later you can find them with $users->find('registeredToNotifications=1'). To build forms for free you can use module InputfieldForm, for example for the form to register to notifications. To send mails you can use PHP mail function, if your server is well configured to send mails. 1 Link to comment Share on other sites More sharing options...
Webjack Posted January 9 Author Share Posted January 9 Gosh, that's a good answer and well documented too ? Many thanks Da2, I'll look into that too. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now