I have a custom module, in this module there is a field related to the account, then I create an email send button on the detail page, how can when the compose mail popup is displayed, the email of this account is added automatically.
Asked
Active
Viewed 96 times
1 Answers
1
You need to put that logic in your view controller. Take vtigercrm/modules/Vtiger/views/ComposeEmail.php
as an example and create vtigercrm/modules/YourCustomModule/views/ComposeEmail.php
You need to do something similar to this when processing the request:
$accountId = $request->get('accountid');
$account = Vtiger_Record_Model::getInstanceById($accountId);
$viewer = $this->getViewer($request);
$viewer->assign('TO', $account->get('email'));

Ruben Estrada
- 338
- 1
- 7
-
1Thank you, it's really what i needed – colinmorgan Nov 25 '21 at 03:24