Hi.
We (a french Academic library) are using Rules that way :
- our patrons are asking us some questions using some webforms ;
- each time a webform submission is created, Rules sends an email to librarians with a certain role (let's call it the role "librarian") ;
- that mails contains a link to that submission : the first librarians that has time, goes to that webform submissions, and uses hidden field to give an answer to the patron. When the librarian updated the webform submission with the answer, rules sends a email to the patron with that answer.
That workflow works perfectly... for the admin role.
The problem is on the librarian role : the outgoing mail aren't going out, and we've each time an error message that tell's us that the mail didn't come out (when it goes out for the admin...)
Looking closer, I see in the error message that [data:votre_e_mail-value] (which is the e-mail of the patron asking the question) that I use for sending the mail, comes out empty with the librarian role, fullfilled and correctly for the admin.
Can't see how to solve that. Can't see any permissions about "sending an email", etc..
Any help welcome
Regards
D
Comments
Comment #1
dbourrion commentedAnd it looks like if webformrules is not able to catch [data:your_e_mail-value] when the backoffice user is identified by CAS - it explains nothing, but that's the point : with a simple Drupal user, the mail goes out ; with a CAS user, I've an error.
D.
Comment #2
stborchertDid you try to print out the complete submission data?
Install Devel and create a new reaction ("execute custom php") which does
<?php dpm($data); ?>. This will give you all the submitted data from webform.Do you have any field-access modules enabled? Maybe the user isn't allowed to see the value of the field.
Comment #3
dbourrion commentedHi
Finally found what was going on (and so, solved it).
Some of the people in the Librarian rôle didn't complete their mail into their user description...
Rules doesn't like empty mail fields...
After habing completed that field, everything goes smooth.
Thx
Regards
D.
Comment #4
dromansab commentedHi,
I've the same problem. I'm trying to send an email when a webform is submitted and it doesn't work.
{ "rules_webform_confirmation_mail" : {
"LABEL" : "Webform confirmation mail",
"PLUGIN" : "reaction rule",
"REQUIRES" : [ "rules", "webform_rules" ],
"ON" : [ "webform_rules_submit" ],
"DO" : [
{ "mail" : {
"to" : "[data:val-mail]",
"subject" : "test",
"message" : "test",
"language" : [ "" ]
}
}
]
}
}
Comment #5
firfin commented@dromensab: Or you sure you have the same problem? In that case just make sure that the user getting mailed have their email adresses set in their accounts. ;-) See comment #3
Did you try turning on rules debugging? Also try the suggestion in #2. These will give you very good hints as to what is going wrong.
Comment #6
stborchert@dromensab: please reopen if you the problem still exists (and please provide some more information! "doesn't work" does not really help).
Comment #7
dromansab commentedHi,
thanks for your response.
I've create this rule:
- Event: After a webform has been submitted
- Action: Send mail
If I introduce a mail like name@example.com, the mail is sent. But if I try to introduce a token ([data:val-email]) with data from the webform submission, the mail is not send.
I've tried to print email with a custom php code:
<?php print $data->['components']['email']['value']; ?>and nothing is printed...dpm($data) works and print all submitted information.
Thanks!
Comment #8
stborchert[data:val-email]is no valid token generated by Webform Rules. The token has to be named "[data:{component}-value]" where "{component}" needs to be replaced with the name of the component (in your case "email"):[data:email-value]should work.Comment #9
dromansab commentedYes, it works!!
Thankss!!!!