Modify email message programatically
-
Hi,
I am trying to modify the email message for an email action via the ninja_forms_run_action_settings filter.
Here is my code:
add_filter('ninja_forms_run_action_settings', 'sg_download_nf_success_message', 11, 4); function sg_download_nf_success_message($action_settings, $form_id, $action_id, $form_settings) { if($form_id == 1 && $action_id = 2) { $subject_message = get_field( 'subject_message', 'option' ); $form_message = get_field( 'form_message', 'option' ); $action_settings['email_subject'] = $subject_message; $action_settings['email_message'] = $form_message; } return $action_settings; }The problem is that this alters all messages and subjects for all my email action.
How can I target the['email_subject']and['email_message']for a specific action.Or is there a way to add acf fields (from an option page) via the merge tags in the ninja forms interface?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Modify email message programatically’ is closed to new replies.