Hello,
Sorry for the late answer! Your report reminds me that I should give you the ability to retrieve any ACF field of the current post (or a custom post id) using template tags!
The current template tag for Dynamic Forms {field:my_field}
retrieve the text input (what user has written in the input), not the field in database.
In your case, you want to retrieve a field saved in the DB of the current post, so it would be nice to have a template tag: {field:hotel_email:current_post}
, so you can use it dynamically in your E-mail action. This template tag would be the same as doing get_field('hotel_email')
in PHP.
I’ll add this feature in the the Trello board!
Meanwhile, you can use an alternative method:
– Create a new “Custom Action”
– Call it: get_hotel_email
and put it right before your E-mail action
– In your functions.php
file, add the following code:
add_action('acfe/form/submit/get_hotel_email', 'acfe_form_get_hotel_email', 10, 2);
function acfe_form_get_hotel_email($form, $post_id){
// Change the field name accordingly
$hotel_email = get_field('hotel_email', $post_id);
set_query_var('hotel_email', $hotel_email);
}
– In your E-mail action, use the template tag {query_var:hotel_email}
in order to dynamically display the hotel email field
– Done!
Here is a screenshot of the admin screen: https://i.imgur.com/oId4WWG.jpg
I’ll let you know when the update comes out for the new template tag, so you can remvove the custom action and directly use it in the E-mail action!
Note: This alternative method will keep working after the update, it’s just for the sake of comfort.
have a nice day!
Regards.