Hello,
Thanks for the feedback! You said “Emails are going through no problem”. Email are correctly sent and the content is okay?
What kind of operation are you doing in that acfe/form/submit/email
hook? I would suggest to use acf_log()
instead of var_dump()
to debug variables in hooks (to avoid break page headers and such). When using acf_log()
the data is logged in the /wp-content/debug.log
file (WP Debug Log must be enabled).
Can you try to make a acf_log($form)
& acf_log(get_field('client_name'))
in your hook and check the result in the debug file?
I’ll run some tests on my side too.
Regards.
Hello,
I just checked and everything works fine. However, it looks like there is a problem in your code, since you using this hook with 3
arguments:
add_action('acfe/form/submit/email/form=clients', 'my_form_submit', 10, 3);
But your function only have 2:
function my_form_submit($form, $post_id)
Also you’re using the wrong arguments, the correct arguments are the following: $args, $form, $action
. There is no $post_id
.
Please refer to the documentation for usage example: https://www.acf-extended.com/features/modules/dynamic-forms/e-mail-action#submit
In your case:
/*
* E-mail Submit
*
* @array $args Email arguments
* @array $form Form settings
* @string $action Action name
*/
add_action('acfe/form/submit/email/form=clients', 'my_form_submit', 10, 3);
function my_form_submit($args, $form, $action){
acf_log($args);
acf_log($form);
acf_log(get_field('client_name'));
}
Hope it helps!
Regards.
Hello,
I get back to you since that I stumbed upon a bug which break the get_field()
inside an ACFE Form action when a previous actions save additional meta fields (which is probably your case).
I’m working on a fix, it should be up today. I’ll keep you updated here.
Sorry for the inconvenience.
Regards.
Yes, I’m pretty sure it has to be be with previous actions.
Everything else seems fine.
I was unable to get debug.log to work.. might be security on my side. Will have to investigate a little bit more.
But fields are empty when sending but default php functions works. I never had any issues until the last patch 😉
Thank you for working so hard.
Hello,
Just a heads up to let you know that the latest ACF Extended 0.8.8.1 patch fixed that issue. Please check your form, everything should be fine now.
My post about hook arguments is still relevant tho, check your code just in case.
Sorry for the inconvenience.
Have a nice day!
Regards.
That fixed it 🙂 Thank you so much!