-
-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dev/core#295 - Allow default 'from' email to be set in New email form #12603
Conversation
(Standard links)
|
@mattwire @seamuslee001 I feel like you have been involved in this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jitendrapurohit I've reproduced the issue and agree we should fix it. But can you modify your code per my comments?
$form->_fromEmails = $fromEmailValues; | ||
if (!Civi::settings()->get('allow_mail_from_logged_in_contact')) { | ||
$defaults['from_email_address'] = key(CRM_Core_OptionGroup::values('from_email_address', TRUE, NULL, NULL, ' AND is_default = 1')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, we shouldn't be calling CRM_Core_OptionGroup::values directly here. I think the correct function to use would be CRM_Core_BAO_Domain::getNameAndEmail()
from here: https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/BAO/Domain.php#L172
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mattwire Updated the PR with the above function replacement.
ef582a5
to
7a7019f
Compare
test this please |
@mattwire can you recheck |
Thanks @mattwire @jitendrapurohit |
Overview
Allow default from email address to be set as default on the "New Email" form.
Before
Default From address is not loaded as default on the email form.
SE Post - https://civicrm.stackexchange.com/questions/25562/why-does-the-default-from-email-address-not-show-as-the-first-option-when-usin
After
If
Allow Mail to be sent from logged in contact's email address
is disabled in settings, defaultfrom
address is loaded on the form.Gitlab issue - https://lab.civicrm.org/dev/core/issues/295