Answer the question
In order to leave comments, you need to log in
How to set up forwarding emails to different mailboxes in wordpress depending on the selected item?
Hello! There is a site on wordpress , where I want to implement a feedback form with the ability to select the type of appeal, so that, depending on the type chosen, the message is sent to the appropriate mailbox and statistics are saved in the personal account.
How can this be implemented? Perhaps there is a ready-made functionality in some plugin for these purposes?
Answer the question
In order to leave comments, you need to log in
Hello.
About ready and convenient I do not know. And so, Contact Form 7 + Flamingo.
To change the email, I remember using the wpcf7_before_send_mail hook.
Something like this:
add_action('wpcf7_before_send_mail', 'dco_wpcf7_before_send_mail');
function dco_wpcf7_before_send_mail($contact_form) {
$submission = WPCF7_Submission::get_instance();
$data = & $submission->get_posted_data();
$subject = $data['your-subject'];
if ($subject == 'Директор') {
$mail = $contact_form->prop('mail');
$mail['recipient'] = '[email protected]';
$contact_form->set_properties(array('mail' => $mail));
}
if($subject == 'Менеджер') {
$mail = $contact_form->prop('mail');
$mail['recipient'] = '[email protected]';
$contact_form->set_properties(array('mail' => $mail));
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question