Hello all,
First of, I'dl like to thank you all for reading this. As a newbie to rules, I would understand if people find my post too complicated or unclear.
I am currently in the process of creating a routine as part of a website I am developing. This routine is a major part of the website goal.
Basically, I want to the do the following:
1- User A sends email request to User B asking him to complete a form stored at a node created by User C or by Admin (i.e. myself)
2- If User B accepts, User B fills in form which at the end contains a link back to my website
3- User A gets informed through email notification
4- User A profile is updated at the same time
My questions are as follows:
- Can it be done with rules?
- How many rules are involved? 4 or more?
- Can I set a schedule on this to automate the process on a weekly basis?
I have no example in mind but if someone could point me out to an existing example or even give me some word of advice, that would be greatly appreciated.
Regards
T
Comments
Kind of
I'm not sure I get the details of every step in your process, but at least some of the things can be done with Rules. The thing that probably can't be done with Rules is (1) – to let user A send a request to user B. To solve this, I would probably let this contact be formalized by the creation of a new node.
Something like this:
-1a-
User A finds The Form and wants user B to fill it in. He/she uses a custom link to send this request, which actually in Drupal terms is to create a new node.
(To build this node type, check out Node Reference URL Widget for automatic node references to the form node, use Automatic Nodetitles to set the title field to user + date and at the same time hide it from the form, and use Email module + CCK to let the new node just have a single e-mail field to fill in. Preferrably, user B has already an account on the site, and you use a User Reference field instead of the e-mail field.)
-1b-
When the contact node is filled in, a Rule is triggered. It sends an e-mail to user B. (Address is provided in the node, and so is the link to the form to fill in – they are all available as Tokens inside the Rules framework.) The rule should trigger on "new content is saved" and have as a condition that the saved content is of type contact node.
-2-
User B fills in the form. If you're using Webform (which I assume you do), you can use form settings to set confirmation message or redirect path to whatever you like – no Rules necessary.
User B has to identify him/herself in some way in the form. It is probably much easier if B has an account on the site – otherwise you'll have to collect the e-mail address in the form and then extract it, and I'm not sure that Rules can get the information from Webform easily.
-3 and 4-
When the form is submitted, a triggered rule is activated. (I'm actually not sure that Webform has a suitable trigger for this, but I'm hoping so.) The rule identifies user B and The Form, and sends these as arguments to Views Bulk Operations. (See an old blog post of mine for some details on this.) VBO searches all the contact nodes and finds the ones where user B has been contacted about The Form. It performs A Rule Set on each of these nodes.
The Rule Set consists of (a) sending an e-mail to the author of the contact node, and (2) loading the user profile for the contact node and modifying some of the fields in it. (I'm assuming you're using Content Profile.)
-5-
You take a cup of tea, sit back, and let your site kick some ass for you. :-)
I hope this might help getting started!
//Johan Falk, NodeOne, Sweden
Excellent stuff
Hi Itangalo,
This is an excellent piece of advice you have given me here. I wouldn't have thought of that at all. This is far more intricate that I anticipated. Needless to say that I will do as you recommended.
Thank you so much for your help and feedback.
T