Node content into the body of an eMail

sdsheridan - March 17, 2009 - 06:31
Project:Workflow-ng
Version:5.x-2.2
Component:Wng User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

I'm trying to create a daily eMail of the body of a node (which actually contains the results of two views via the "insert_view" module) to be sent out to users of a selected role. I have the node created, and I have the rule created to send a daily eMail to users of a particular role. The only thing that's stumping me is how to get the contents of a node (or frankly just the body of the node) into the eMail. Alternatively, I'd be just as happy to insert the results of the two views into the body of the eMail.

Anybody have any ideas on how I could do this?

Thanks, Shawn

#1

sdsheridan - March 17, 2009 - 17:11

OK so figured out a way to hack the workflow_ng_system.inc include to do what I want to do with views, by leveraging the "insert_view" module. Right after all the extract( workflow_ng_token_replace_all(array('message' => 'message') + $names, $settings, $arguments, $log) ); calls, I've place the following snippet:

<?php
 
if ( module_exists( "insert_view" ) ) {
   
$message = insert_view_filter( "process", 0, -1, $message );
  }
?>

That seems to be working for me, and leverages all the "insert_view" functionality now in workflow_ng eMail capabilities. Sweet!

Shawn

 
 

Drupal is a registered trademark of Dries Buytaert.