I have a view with a lot of exposed filters that I would like to add the ability for a user to save their searches and then be emailed when there are updates. The module Views Save does the first half but I have no idea how I can email updates, can any body point me in the right direction? I have also seen the Search API Saved Searches module that does war I want but only for search api views.
Asked
Active
Viewed 266 times
1 Answers
0
We can use [Rules] (https://www.drupal.org/project/rules) module.
Event: view save event. Views rules is the closest one I can find.
Condition: User with entity Views Save associated with view saved in current event. I don't see this available/exist. But would be easy to implement one (ref: rules_example in examples module).
Action: Send mail to user.
Note: you may not want to send mail to user all the time when we save a view. So you may need to add a option in view level to say 'trigger email notification' or a separate page in your custom module which allow to select a view and email template.

vijaycs85
- 197
- 3
- 15
-
Thanks very much i think this is along the right lines, just to be clear when new content is added to the site that fits the search that the user has made the email will be sent, would this have to run on cron? – Drupal noob Jul 11 '14 at 08:46
-
Yes, in case of content change, you may need to keep some state (say for example hash of all ids of a view) to know if there a change in the views_save and may be a cron to send the notification. You can refer https://www.drupal.org/project/newsletter module for an **idea** of how to schedule & send notifications. – vijaycs85 Jul 15 '14 at 15:54