Hi!
I wanted to know if there is a way to assign the value of some specific fields in the subject of the email received from the Avia Contact Form?
I would like to have the “name” and the “you are” from the form on this page in the subject of the received email: https://opinary.com/contact/.
Basically tweak this code from the “class-form-generator.php” file:
$subject = empty($new_post[‘subject_’.$this->formID]) ? __(“New Message”, ‘avia_framework’) . ” (“.__(‘sent by contact form at’,’avia_framework’).” “.$myblogname.”)” : $new_post[‘subject_’.$this->formID];
Any idea?
Thank you
Hey 24trentedeux,
Here is a thread for you to consider
https://kriesi.at/support/topic/email-subject-from-contact-form-subject/#post-593555
If you need further assistance please let us know.
Best regards,
Victoria
Hi!
Ok this is what I’m looking for! Can you detail how to choose what appears and what the code does exactly please?
add_filter(‘avf_form_subject’,’avia_change_mail_subject’, 10, 3);
function avia_change_mail_subject($subject, $new_post, $form_params) {
$subject = urldecode($new_post[‘3_1’]);
return $subject;
}
Thank you!
I found what I wanted, thank you very much!
Hi,
Great, glad you found a solution and thanks for the feedback. Please let us know if you should need any further help on the topic or if we can close it.
Best regards,
Rikard
Hi,
You can close it thank you!
Best,
Philippe