Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
Contact Form 7

wpcf7_mail_sent Hook

Trigger side effects after mail successfully sends.

Contact Form 7 Tutorial Series (39/100). Prefer one article? Read the complete Contact Form 7 tutorial.

Short description

Use `wpcf7_mail_sent` for CRM pushes, Slack alerts, and analytics server events.

mail_sent example

add_action('wpcf7_mail_sent', function ($contact_form) {
    $submission = WPCF7_Submission::get_instance();
    if (! $submission) {
        return;
    }
    $data = $submission->get_posted_data();
    // sync $data
});

Leave a reply

Your email address will not be published. Required fields are marked *