[development] Send Contents of new node by email
ernst.pluess at gmail.com
Wed Jan 27 15:20:27 UTC 2010
After the user hits "Send" for a new cck node, I'd like to send the contents
of this node by email. In order to do so I installed the print module.
Then I call the appropriate function of the print module in hook_nodeapi.
This works fine as long as I am the admin user.
The anonymous user gets the access denied page. After some debugging it
turned out, that at this point the node_access table is not yet written,
which makes the access check of the print module thinking the anonymous user
does not have the right to view this node.
Any ideas to solve this problem?
My code in hook_nodeapi:
// Mail distribution
// To: Gad Intake
module_load_include('inc', 'print_mail', 'print_mail');
$form = array();
$form_state = array(
'values' => array(
'fld_from_name' => 'Gad Formulare',
'fld_from_addr' => 'form at gadform.ch',
'chk_teaser' => 0,
'path' => 'node/'.$node->nid,
'fld_subject' => t('New Registration'),
'txt_to_addrs' => variable_get('zuweisung_intake_mail_adr', '
intakeuser007 at gmail.com'),
// To: The institution filling in the form
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the development