send also as email, status=publish
-
Dear Aurovrata Venet,
thank you for yout great plugin!Unfortunately I have two problems and I didn′t found an answer. My form is mapped to posts. I used the helper boxes to get my posts public, but that does not work.
add_action( 'cf7_2_post_status_post', 'publish_new_post',10,3); /** * Function to change the post status of saved/submitted posts. * @param string $status the post status, default is 'draft'. * @param string $ckf7_key unique key to identify your form. * @param array $submitted_data complete set of data submitted in the form as an array of field-name=>value pairs. * @return string a valid post status ('publish'|'draft'|'pending'|'trash') */ function publish_new_post($status, $ckf7_key, $submitted_data){ /*The default behaviour is to save post to 'draft' status. If you wish to change this, you can use this filter and return a valid post status: 'publish'|'draft'|'pending'|'trash'*/ return 'publish'; }
I would also like to receive my form by email. With the Save button, a post is created. The standard send button sent the e-mail, but both do not work at the same time. I assume, I need this hook:
add_fitler ('cf7_2_post_draft_skips_mail', 'force_notification'); / ** * Function to force mail sending for draft form saving. * @param boolean $ skip_mail true by default. * @param string $ cf7_key Unique key to identify your form. * @return boolean false to send mails on draft form saving. * / function force_notification ($ skip_mail, $ cf7_key) { / * For forms which have a save button, the mailing forms are skipped by default. This filter allows you to force mail notification of draft forms. * / if ('my-form' == $ cf7_key) { skip_mail = false; } return skip_mail; }
but it does not work either.
BTW: I think there are maybe two mistakes inside: first line: add_filter, 12th line: skip_mail == false;Thank you for your advice!
ll.The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘send also as email, status=publish’ is closed to new replies.