Created
June 18, 2025 07:37
-
-
Save annuman97/00ba4708281dfb4145a3fefa03a9cdca to your computer and use it in GitHub Desktop.
Sending Email Notification when Fluent Forms Admin Approval is enabled using wp_mail functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('fluentform/submission_inserted', 'bypass_admin_approval_email', 20, 3); | |
function bypass_admin_approval_email($entryId, $formData, $form) | |
{ | |
if($form->id != 7) { | |
return; | |
} | |
$email = isset($formData['email']) ? sanitize_email($formData['email']) : ''; | |
if ($email && is_email($email)) { | |
$subject = 'Thank you for your submission'; | |
$message = 'We received your form and will review it soon.'; | |
$headers = ['Content-Type: text/html; charset=UTF-8']; | |
wp_mail($email, $subject, $message, $headers); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment