
Tagged: autoresponder, contact, CONTACT FORM
-
AuthorPosts
-
July 15, 2025 at 11:53 am #1486795
Hi,
I’m using following code in the functions.php to have “Ja” und blank for “false” in Contact form messages.
add_filter('avf_form_message', 'avf_form_message_mod_checkbox', 10, 3); function avf_form_message_mod_checkbox($message, $new_post, $form_params) { $message = str_replace('true', 'Ja', $message); $message = str_replace('false', '', $message); return $message; }
When setting up the Autoresponder I’m still getting “true” and “false”.
What am I missing to achieve that on that end as well?
Kind regards.
-
This topic was modified 3 weeks, 6 days ago by
tebitrongmbh.
July 16, 2025 at 7:13 am #1486847Hey tebitron,
Thank you for the inquiry.
You can use the avf_contact_form_autoresponder_mail to filter the content of the autoresponsder message.
Example:
add_filter("avf_contact_form_autoresponder_mail", function($mail_array, $new_post, $form_params, $class) { $mail_array["Message"] = str_replace('true', 'Ja', $mail_array["Message"]); $mail_array["Message"] = str_replace('false', '', $mail_array["Message"]); return $mail_array; }, 10, 4);
Let us know the result.
Best regards,
IsmaelJuly 16, 2025 at 2:42 pm #1486879Hi Ismael,
thanks.
I didn’t replace the other, I just added yours like this:
add_filter('avf_form_message', 'avf_form_message_mod_checkbox', 10, 3); function avf_form_message_mod_checkbox($message, $new_post, $form_params) { $message = str_replace('true', 'Ja', $message); $message = str_replace('false', '', $message); return $message; } add_filter("avf_contact_form_autoresponder_mail", function($mail_array, $new_post, $form_params, $class) { $mail_array["Message"] = str_replace('true', 'Ja', $mail_array["Message"]); $mail_array["Message"] = str_replace('false', '', $mail_array["Message"]); return $mail_array; }, 10, 4);
Works perfectly.
Best regards.
July 16, 2025 at 8:52 pm #1486896Hi,
Great, I’m glad that Ismael could help you out. Please let us know if you should need any further help on the topic, or if we can close it.
Best regards,
RikardJuly 21, 2025 at 11:18 am #1487067Thanks Rikard, you can close it.
-
This topic was modified 3 weeks, 6 days ago by
-
AuthorPosts
- The topic ‘Alter “true” and “false” in Autoresponder-Email’ is closed to new replies.