Closed (fixed)
Project:
Views Contact Form
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Oct 2019 at 12:45 UTC
Updated:
28 Oct 2021 at 01:24 UTC
Jump to comment: Most recent
Comments
Comment #2
Search4 commentedHi, i have the same problem. Did you find the solution?
Comment #3
viswanathsai commentedMaybe this module is not under active maintenance, i resolved my issue by using pseudo field to store email id of user which i got by form_id, i can use that field as recipient email field to send mails to contact form user.
function hook_form_alter(&$form, &$form_state, $form_id) {
// Recipient Email Dynamically
$form_uid = $form['#form_id'];
$formid = preg_replace("/[^0-9]/", '', $form_uid);
if (!empty($formid)) {
$account = \Drupal\user\Entity\User::load($formid); // pass your uid
$recepiant_email = $account->getEmail();
$form['elements']['recepiant_email']['#default_value'] = $recipient_email;
}
// Recipient Email Dynamically END
}
Comment #6
balajidharmaComment #8
balajidharmaIssue fixed on 2.x branch and tested latest D9 version
https://www.drupal.org/project/views_contact_form/releases/2.x-dev