Tyssen Posted July 16, 2020 Share Posted July 16, 2020 Does anything exist within PW for people to be able to subscribe to updates? So you enter your email address and when new blog posts are published, you get an email alert? And I guess there also needs to be a way for people to unsubscribe too. Does anything exist like that for PW? Link to comment Share on other sites More sharing options...
kongondo Posted July 16, 2020 Share Posted July 16, 2020 There's these two, but the latter is no longer maintained: https://modules.processwire.com/modules/subscribe-to-mailchimp/ https://modules.processwire.com/modules/newsletter-subscription/ Link to comment Share on other sites More sharing options...
Tyssen Posted July 16, 2020 Author Share Posted July 16, 2020 So is the idea to use Mailchimp's RSS to email feature? Link to comment Share on other sites More sharing options...
kongondo Posted July 16, 2020 Share Posted July 16, 2020 14 minutes ago, Tyssen said: So is the idea to use Mailchimp's RSS to email feature? You can read more about it here: Link to comment Share on other sites More sharing options...
Tyssen Posted July 16, 2020 Author Share Posted July 16, 2020 I can see that you can use the module to add subscribers to a Mailchimp list, but it seems like you could just use a Mailchimp form to do that. I'm not seeing anything in there about there being a link between publishing content in Processwire and then subscribers receiving emails about that event. Link to comment Share on other sites More sharing options...
kongondo Posted July 16, 2020 Share Posted July 16, 2020 21 minutes ago, Tyssen said: I'm not seeing anything in there about there being a link between publishing content in Processwire and then subscribers receiving emails about that event. I see. There seems to be nothing presently that suits your needs then (but others can chime in). If that's the case, you can roll your own. A most basic one would consist of two parts. Publishing a post: A hook to monitor this event (e.g. in ready.php) should do the trick. You could send the emails right within the hook. How and when you do it depends on how many emails you have to send. Subscribe/Unsubscribe: There is a module, I think for email subscriptions? If not you would have to store this somewhere. Ryan wrote about this somewhere, how he does it with ProcessWire weekly newsletters. I think they are just pages. Link to comment Share on other sites More sharing options...
horst Posted July 16, 2020 Share Posted July 16, 2020 Maybe the ProMailer can help out? Quote ProMailer is the ideal tool for creating and sending email newsletters and managing subscribers in ProcessWire. 2 Link to comment Share on other sites More sharing options...
kongondo Posted July 16, 2020 Share Posted July 16, 2020 3 minutes ago, horst said: Maybe the ProMailer can help out? How could I forget this? Hehe. Thanks for the reminder ? 1 Link to comment Share on other sites More sharing options...
Tyssen Posted July 17, 2020 Author Share Posted July 17, 2020 So would that still be using a webhook as described in #1 by @kongondo above and using ProMailer for #2? Or does the triggering of emails when pages are published exist in ProMailer already? Link to comment Share on other sites More sharing options...
kongondo Posted July 17, 2020 Share Posted July 17, 2020 18 minutes ago, Tyssen said: So would that still be using a webhook as described in #1 by @kongondo above and using ProMailer for #2? Or does the triggering of emails when pages are published exist in ProMailer already? I think you still need #1, but that's the easy bit ? https://processwire.com/store/pro-mailer/ Link to comment Share on other sites More sharing options...
Tyssen Posted July 17, 2020 Author Share Posted July 17, 2020 So in ready.php it would be something like this? wire()->addHookAfter('Pages::published', function($event) { $page = $event->arguments('page'); $t = wire()->templates->get($page->template); if($t->name == 'blog') { // what goes here? } $event->return = $page; }); Link to comment Share on other sites More sharing options...
kongondo Posted July 17, 2020 Share Posted July 17, 2020 Something like this... wire()->addHookAfter('Pages::published', function($event) { $page = $event->arguments(0); if($page->template !='blog-post' ) return; // ProMailer API TO SEND EMAILS // no need to return $event if you haven't modified it }); Talk to Ryan about ProMailer API if what you need does not exist here https://processwire.com/api/ref/pro-mailer/ Link to comment Share on other sites More sharing options...
Tyssen Posted July 17, 2020 Author Share Posted July 17, 2020 Where's the place to post Promailer questions before purchasing the module? @ryan Link to comment Share on other sites More sharing options...
bernhard Posted July 17, 2020 Share Posted July 17, 2020 Depending on the situation (how many subscribers etc) this could be really simple to implement on your own: A form that subscribes an email to the current page (using $page->meta('subscribers') for example) A hook that sends an email on every publish of a child of the subscribed page (using WireMail) A magic link in every email to unsubscribe (eg unsubscribe section or unsubscribe all) It get's more complicated of course if you got a larger number of subscribers or you need to deal with legal stuff (opt-in, mail confirmation links etc) - but sometimes simple solutions are totally fine (eg if you only have a handful of trusted users)... Link to comment Share on other sites More sharing options...
Tyssen Posted July 19, 2020 Author Share Posted July 19, 2020 @bernhard Presumably the hook for #2 could look the same as the one @kongondo wrote above? It doesn't necessarily need to be a child of a particular page, but instead match a template. And for #3, what would the magic link look like, how would it be generated? 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