I have a webform, and I'd like to be notified whenever someone edited his own submits. I'm using the Webform module.
I found the Webform Rules module but I didn't get how to use it, any way to set this up?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
Using Webform Rules (and Rules of course), it's a peace of cake to send an eMail using Rules Event "
After a webform submission is updated". To actually do so, refer to the answer from CodeNext. However, the real challenge in this question here, is to address this part of the question: "someone edited his own submits". Read on for more details on how to implement that part of it.
With these assumptions in mind, you'll need to have something in your webform available to store, as part of the submitted webform, the uid of the user who actually submitted the webform. I've not found (yet) any such data that is available as a token to Rules (you'll need it in Rules to get this challenge to work). So therefor I'd use an approach like adding an extra (hidden?) webform field that is automatically set (eg using Rules) when the webform is first submitted, let's say using a field with machine name
After all the above is in place and agreed about, you're in good shape to address the challenge "someone edited 'his/her' own submits": all you'd have to do is to further enhance the rule detailed in the prior answer, by adding an appropriate Rules Condition, to check if the uid of the currently logged in user matches
But, there is 1 more challenge to implement that extra Rules Condition: how should the Rules token look like for the value of
field_webform_submitter_uid? To find the answer to this, refer to the README.txt of Webform Rules: based on what's documented there, the token to be used in that extra Rules Condition should be [data:field_webform_submitter_uid-value].
Note (about the token for the uid of the user who submitted the webform): each submission has data like "submitted by" and "submitted on", however from all
uid-variations I've experimented with, none of them contain the value that always matches the "submitted by" (not to be confused by tokens like
node:author:uid, those are for sure not what matches the "submitted by"). To convince yourself, try a scenario where the user who submitted the webform is different from the one who edits that submission ...
Note: Please Do not follow this Answer, as I misunderstood the requirement previously. You can follow this to get the general idea of how to create Rules
Now, if you go to Admin/Config/Workflow/rules.
1. Create a new Rule and select event, as shown in following image I have created a new rule named
Webform Edit Notification. Then select a Event, as you can see in image, I have selected a option under Webform
After a webform submission is updated
2. Select the Action, from options I did choose
Send a mail as shown in following image. If you save a move to next step it will open a new page for sending a email setup.
3. TO: Now first field is TO whom you want to send. As you click the button
switch to the direct input mode and click on the data selector the options as shown in image will open.
Now form the image I am selecting
node:...(The webform node). After selection it will show options which are under that under that. So I am selecting
node:author:...(Author). Then again same in next step I am selecting
Hence, It will end up as
node:author:email which translate,
**Email address of Author of that particular node** So this will make a TO:
Then you can add,
So, this way it will send a mail to the mail to the author of that webform.
I have not used this as I am not using in my site, But this is the logic. You can try it to validate it before finalizing for Live site.