-
-
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
Move from_email_address
options to new DomainEmailAddresses table
#31909
base: master
Are you sure you want to change the base?
Conversation
🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷 Introduction for new contributors...
Quick links for reviewers...
|
85d2958
to
1c5672a
Compare
Personal feeling: yes, please, for the love of god, yes. Big consideration is going to be technical interop for extensions and sysadmin scripts. (In my copy of (Like... In the future, we may get some better options to address permissions and routing if it's a proper entity. Small aside |
I don't deal with from_email_address much, but the proposed schema looks good to me. What would be the best practice in Civi for maintaining a single |
I added a unique index to the table for that, and the business logic would include an implementation of |
Well in Civi-land, |
a074321
to
8125154
Compare
Ah, good point. Terms are painted into a corner. Dealers choice. |
5658e96
to
ba3bdc6
Compare
CRM/Upgrade/Incremental/schema/6.0.alpha1.DomainEmailAddress.entityType.php
Outdated
Show resolved
Hide resolved
Introduce a new entity type `DomainEmailAddress` as an alternative to the 'from_email_address' option group.
Replaced legacy "from_email_address" option group references with the new DomainEmailAddress API.
Removed unnecessary domain filtering logic from OptionValue as this was the only option group it applied to.
ba3bdc6
to
8d98958
Compare
8d98958
to
571ef84
Compare
from_email_address
options to new DomainEmailAddresses table
571ef84
to
f8d1eb4
Compare
Wraps the OptionValue api (v3 and v4) to provide backward compatibility for accessing DomainEmailAddress via the OptionValue api. CRM_Core_OptionGroup::values and ::getDefaultValue are also supported.
Removes unused handling from the quickform
f8d1eb4
to
b59c4a7
Compare
Overview
Moves the 'from_email_address' option group into its own table: Introducing the new
DomainEmailAddress
entity. 🎉Migration and Backward Compatibility Notes
This adds an apiWrapper for backward-compatibility, to allow
DomainEmailAddress
records to be accessed as if it were an option group. When accessing it via the OptionValue api, the newemail
andname
columns are concatenated to produce familiarvalue
of"Name" <[email protected]>
, andid
is returned asvalue
. Here's what is and is not supported:$params
must contain'option_group_id' => 'from_email_address'
$params
must contain'option_group_id' => 'from_email_address'
create
+ anid
)id
of an existing domainEmailAddress and a correctly formatted email header asvalue
delete
action only gets passed anid
which is not enough info for the adapterget
chained with create/update/delete will all workWHERE
must contain'option_group_id:name', '=', 'from_email_address'
WHERE
must contain'option_group_id:name', '=', 'from_email_address'
$values
must contain'option_group_id:name' => 'from_email_address'
WHERE
must contain'option_group_id:name', '=', 'from_email_address'
universe
so didn't add support for thisCRM_Core_BAO_Domain::getNameAndEmail
CRM_Core_BAO_Domain::getFromEmail
CRM_Core_BAO_Email::getFromEmail()
CRM_Core_BAO_Email::domainEmails()
CRM_Core_OptionGroup::values
$labelColumnName
,$keyColumnName
,$onlyActive
,$condition
CRM_Core_OptionGroup::getDefaultValue
id
of default email address for current domainCRM_Core_OptionGroup::valuesByID
,CRM_Core_Pseudoconstant::get
, etc.civicrm_option_value
table.New-to-Old column map
id
value
name
label
(in quotes)email
label
(in brackets)description
description
is_active
is_active
is_default
is_default
domain_id
domain_id
Before
The list of from email addresses was not well-placed in the OptionValue table because:
"My Name" <[email protected]>
which wasn't fun for users to type and involved a lot of splitting/unsplitting strings.After
New table has just the fields needed for storing site email addresses. UI switched to SearchKit/FormBuilder: