Set the priority of your filter to 20 so that it runs after ACF has saved the values
add_action('acf/save_post', 'my_save_post', 20);
Then get the values and add them the same way you’d get them for a template
$body = ''; $body .= 'Field Label: '.get_field('field_name', $post_id)."\r\n"; $body .= 'field label 2:'.get_field('field_name_2, $post_id)."\r\n";
You could probably also use either get_fields() https://www.advancedcustomfields.com/resources/get_fields/ or get_field_objects() https://www.advancedcustomfields.com/resources/get_field_objects/ and use a loop to add them to the body. The main difference between a template and what you’re doing is that you need to add the values to the string rather then display them.
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!
© 2022 Advanced Custom Fields.