Commit 6c079c9d authored by Stan Dragnev's avatar Stan Dragnev Committed by Monish Deb

refs #202: pick from email address when emailing

parent 461ccf7e
......@@ -328,8 +328,17 @@ WHERE civicrm_contact.id = $id ";
),
'PDFFilename' => '',
);
$defaultAddress = CRM_Core_OptionGroup::values('from_email_address', NULL, NULL, NULL, ' AND is_default = 1');
$emailQuery = "SELECT from_email_address FROM civicrm_grant_program WHERE id = %1";
$defaultAddress = CRM_Core_DAO::singleValueQuery($emailQuery, array(
1 => array($values['grant_program_id'], 'Integer')
));
if (!isset($defaultAddress) || $defaultAddress == '') {
$defaultAddress = CRM_Core_OptionGroup::values('from_email_address', NULL, NULL, NULL, ' AND is_default = 1');
}
foreach ($defaultAddress as $id => $value) {
$sendTemplateParams['from'] = $value;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment