2

Required functionality (Drupal 7):

  • User filters a view to desired results
  • User enters email address in a webform block
  • User is emailed the filtered list of results

I'm using Views (7.x-3.14), Webform (7.x-4.14) and Rules (7.x-2.9)

I've looked at a few modules surrounding saving your search results, but nothing I've found seems to help very much. Are there a combination of modules that I might be able to use (Rules, Cron etc.) that will achieve this or do you think I'll need to write something custom?

I'm still learning how to write custom Drupal modules so if anyone can point me in the right direction, that would be appreciated !

  • How this action should be triggered, via a link, on submit, something else? – mchar Dec 13 '16 at 14:02
0

If your view is a page, should be as easy as grabbing the page url when the form gets submitted and based on the url (if statement) you attach a view that has a filter of "X". (slight chance that it is doable with rules and webform module)

If it's a block, gets a bit more complex. You would have to check what the filter is set to using jQuery, and then pass that variable to a custom module when the form is submitted. Then module triggers x function based on the view filter value that sends e-mail with view x.


Actually, an even more simpler option, have a hidden field of checkboxes (hide it with css) on your webform that has a box for each filter. Then with jQuery you can autocheck option x if filter is set to x.

Now since your webform contains field of checkboxes with value x, with conditional rules hopefully you can do an if statement on your field of checkboxes and attach view x to your e-mail. (I'm making a lot of assumptions here, as I've never used webform + rules, or maybe I did once... Anyhow, hopefully this will work with Rules)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.