Home › Forums › Front-end Issues › Front end post submit hook › Reply To: Front end post submit hook
Alright, thanks. Sorry, it’s not yet clear yet. Let’s say I would put the next function in functions.php. Then it would send a mail every time a ACF form is saved, right?
<?php function sendMail(){
$to = '[email protected]';
$subject = 'New mail';
$headers = 'From: Themailer <[email protected]';
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$message = '<html><p>Thank you!</p></html>';
mail($to, $subject, $message, $headers);
}
add_action('acf/pre_save_post', 'sendMail', 20); ?>
How would I link this to a specific ACF form? Thanks!
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.