Posted by barckhoff on March 22, 2010 at 2:39pm
Hi,
I've been struggling with finding a way to update a node field after an email has been sent. I've set up the Views Bulk Operations module to send an email to selected users in a view, which seems to be working fine, but I want to be able to update a field the associated node to say that an email has been sent to that user, as part of the workflow & tracking.
I'd hoped that this patch for Mail Logger would help, but alas, it does not seem to work.
There doesn't seem to be any triggers based on system mail sent that would allow me to create a rule to update a node field.
Does anyone have any other ideas on how to do this??

Comments
OK, never mind... I figured
OK, never mind... I figured out how to do this with rule sets.
Here's what I did:
Another way
Another way of doing this would be to have the e-mail not being sent directly from VBO, but from a Rule set you call from the VBO.
This rule set could then do multiple actions, where the first one is to send an e-mail and the last one to update the appropriate CCK field.
The tricky part would be to get the hold of user object and the node object in Rules – VBO can currently only invoke rule sets that have exactly one argument, meaning that you'll pass the user or the node to the rule set (depending on whether you have a user view or a node view). Thus, you'll have to dig out one of the objects using the other.
If the relevant user is the author or the node it will be as easy as doing the "load user" action in rules and the author will be available. If there are more complex relations you'll probably have to do some thinking.
Good luck!
//Johan Falk, NodeOne, Sweden