Posted by rpk on May 19, 2010 at 12:22pm
Hi,
I looked through many of the existing Rules discussions but couldn't find what I'm trying to achieve.
I need to send an email to a specific email address when a profile field gets changed from option No to Yes. The email that gets send should contain the name and email address of the user whose profile field got changed.
I would be glad for help with this!
Comments
Profile in core?
Do you use the cores profile module or is the profile a node?
I'm using the core profile
I'm using the core profile module, not profiles as nodes.
self do, self have
Hm, AFAIK there is currently no module / rule for that. You could build it on your own. just hook into the profile edit form and add a submit handler to check, if the field was changed. Implement the rules_hooks in that module und fire an event in your new form submit handler. it should be not more than 40 loc.
Rules Form
well, I think there might already be a bit of solution. Have a look at this snippet => http://drupal.org/node/363682#comment-1936936
another way could be using rules forms integration so that you can hook into existing forms
Rules Forms Support
The module Rules Forms Support (included in Rules) could probably do what you're looking for -- it acts when selected forms are built, submitted or validated.
I'm not 100 % sure that the user data is available in the rule actions, but I am sure that you can do some checks on just about any element in the form. (You can also programmatically get the e-mail address from the user form being saved.) However, this module is rather tricky and it generally often takes some PHP to get the information out of the forms.
If you haven't gone too far in the website building I would recommend having a look at Content Profile, which uses nodes for extending user data.
If this isn't an option Rules Forms Support could do the trick, but it is a windling road.
Good luck!
//Johan Falk, NodeOne, Sweden
Thanks Itangalo and McGo for
Thanks Itangalo and McGo for pointing me in possible directions!
It does sound like some more tricky programming will be required no matter which route I take, and that is what I was afraid of. I will look into the links you provided and will also think about possible ways to achieve what I need without Rules.
Thanks!