ank Posted January 26, 2017 Posted January 26, 2017 Is it possible to have in inputfield so users can leave there adress and receve an e-mail when the site is updated ? Can i store the email addresses in processwire ? Is this possible ? Any ideas how to do that ? How do i send the email ? I can make a page in Processwire but how to send it ? Beter would be that this is fully automaticly, just send an email with the link to the new page. Is this possible with Processwire ? Thanks Ank
horst Posted January 26, 2017 Posted January 26, 2017 yes this is possible. The link to a page can be retrieved by: $page->httpurl() here you need the full http url, not the internal $page->url (!) Emailsending is simple via wiremail
kongondo Posted January 26, 2017 Posted January 26, 2017 (edited) Are these users in the front or backend? If the backend, users already have email addresses. If you want to automate anything, the normal way is to either user cron or an autoload module (using Hooks). In your case, the latter is a good fit. You would want to Hook into 'Pages:added' (rather than sending emails every time the page is saved) Edited January 26, 2017 by kongondo 1
adrian Posted January 26, 2017 Posted January 26, 2017 I would do it on a page save hook. You might find some useful code to "borrow" from this module: http://modules.processwire.com/modules/process-field-change-notifier/ 1
kongondo Posted January 26, 2017 Posted January 26, 2017 @adrian, page save might result in emails being sent every time that page is edited. I suggest 'Pages:added' instead. 1
adrian Posted January 26, 2017 Posted January 26, 2017 Just now, kongondo said: @adrian, page save might result in emails being sent every time that page is saved. I suggest 'Pages:added' instead. Sure, but he asked for when the site is "updated" - surely a change to a page is an update Just noticed that he wrote: "just send an email with the link to the new page" - so yes, Pages::added would be much better
BitPoet Posted January 27, 2017 Posted January 27, 2017 18 hours ago, adrian said: so yes, Pages::added would be much better Pages::published perhaps even more so 4
ank Posted January 30, 2017 Author Posted January 30, 2017 thanks for the advise, i will try with the solutions here above, i am a front end developer so this is difficult for me. But mayby is it better to have a button (in the back-end) after the pagename, next to the buttons 'edit', 'view' ... to send an email that the page is updated. Is this possible ? So the page can be viewed first before a email is send.
adrian Posted January 30, 2017 Posted January 30, 2017 This module (http://modules.processwire.com/modules/process-page-delete/) is now obsolete, but it will show you how you can add your own page list action button. An easier option might be to make use of the RuntimeMarkup module (http://modules.processwire.com/modules/fieldtype-runtime-markup/) to add an email button to the page editor interface. Hope that helps to get you going.
kongondo Posted January 30, 2017 Posted January 30, 2017 If you went with RuntimeMarkup, you could ask @Macrura how he did it as per this example:
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