• Resolved sporkme

    (@sporkme)


    I thought this would be simple, but no luck so far.

    I tried both omitting all mail settings (error on save) and enabling demo mode (mail not sent, but message also not saved in Flamingo). I only want submissions saved in the db, not emailed – how do I do that?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    Currently there are no ‘skip_mail’ additional setting (future releases might support). For now, you can use ‘wpcf7_skip_mail’ filter to skip mail, like this:

    add_filter( 'wpcf7_skip_mail', 'mycustom_wpcf7_skip_mail', 10, 2 );
    
    function mycustom_wpcf7_skip_mail( $skip_mail, $contact_form ) {
    	if ( 123 == $contact_form->id() ) {
    		$skip_mail = true;
    	}
    
    	return $skip_mail;
    }

    Change the ‘123’ to the actual contact form ID.

    FWIW I couldn’t get this to work on the latest version. Added that code to my functions.php, made sure the form had an id code (e.g. [contact-form-7 id=”123″…) but no dice.

    Edit: Never mind, was a weird caching issue. Working, thanks!

    • This reply was modified 7 years, 3 months ago by timdonovanuk.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Skip sending email?’ is closed to new replies.