Hi Drupalfriends<br><br>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.<br><br>Then I call the appropriate function of the print module in hook_nodeapi. This works fine as long as I am the admin user.<br>
<br>
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.<br><br>Any ideas to solve this problem?<br>
Best Regards<br>Ernst<br><br><br><br>My code in hook_nodeapi:<br><br><span style="font-family: courier new,monospace;"> case 'insert':</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> // Mail distribution</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> // To: Gad Intake</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> module_load_include('inc', 'print_mail', 'print_mail');</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> $form = array();</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> $form_state = array(</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> 'values' => array(</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> 'fld_from_name' => 'Gad Formulare',</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> 'fld_from_addr' => '<a href="mailto:form@gadform.ch">form@gadform.ch</a>',</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> 'chk_teaser' => 0,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> 'path' => 'node/'.$node->nid,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> 'fld_subject' => t('New Registration'),</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> 'txt_to_addrs' => variable_get('zuweisung_intake_mail_adr', '<a href="mailto:intakeuser007@gmail.com">intakeuser007@gmail.com</a>'),</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> ),</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> );</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> print_mail_form_submit($form, $form_state);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> // To: The institution filling in the form</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> $form_state['values']['txt_to_addrs'] = $node->field_zuw_email['0']['email'];</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> print_mail_form_submit($form, $form_state);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> break;</span><br>
<br><br>