Closed (fixed)
Project:
Flag
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Oct 2008 at 12:36 UTC
Updated:
23 Nov 2008 at 16:44 UTC
I'd like to have an Action that unmarks all the nodes having a particular flag, and send the Teasers of them via email. This would be used the My bookmarks view.
I'm implementing a kind of product catalog, where the user can flag the nodes he/she interested in, and ask more info via email. The email should contain the products and the flags should be removed after sending the mail. Any suggestions?
Comments
Comment #1
mooffie commentedThe *proposed* Rules support has a "Trim" action, which can unmark all nodes.
(BTW, I'd hate it if a site deleted my "I'm interested in" list.)
Use e.g. the 'insert_view' module to embed the view in a piece of text you'll then send by email. If Rules doesn't allow you to set the "Input Format" of the text, this won't work, so code this in PHP instead. (Or file a feature request against Rules.)
You really expected to have an action that does *both*? If we wanted to provide an action for every combination of whims, we'd need to provide an infinite number of actions.
Ditto. If every module provided a "send by mail all nodes I'm conerned with", we'd end up with *lots* of actions, each having its own set of cute little bugs. That's why having a "send a view by email" functionality is better.
Comment #2
tian commentedWell, I'd not hate it if I'm doing a kind-of-shopping in this product catalog. Removing flag is necessary because the e-mail is kind of a order/inquiriy about the selected items. Next time the user will ask for information/prices about other/new products.
I'm afraid I have to code this functionality myself...
On sending emails, I'll try out insert_view module, and also viewfield seems to be worth a look, the Send module might be able to send them...
Thanks.
Comment #3
mooffie commentedPlease let us know the modules/code you'll eventually use. It could be a starting point for a handbook page.
Comment #4
mooffie commentedPerhaps I was misunderstood. I meant that Rules makes it possible to use PHP to construct the body of the email. You could use a PHP snippet to embed the "all 'interested in' nodes of the current user" view.
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #6
tian commentedWell, finally I had to switch do D5, but I think the solution can be easily adopted to D6 too. I created a custom module (my first one) with a new node operation in it:
I enabled my module, then I installed the Views Bulk Operations module. I created a new view with the type of "Bulk Operations View" (for further settings see My bookmarks view), and on the Operations tab I checked my operation "Request for quotation" (D6/Views2 works slightly different, see the instructions on Bulk Operations project.)
In the view My cart I have to check all the products first to request for quotation, and press "Request for quotation" button. The nodes are unflagged and sent by mail to the assistant.
Now I'm working on having all of the products in the Quotation cart checked by default (to improve user experience).
Comment #7
tian commentedMy first solution for having all the checkboxes checked is a javascript hack. This is not perfect, as one may turn it off in his browser, but better than nothing:
I put this into the header of my view (php code):