-
-
Notifications
You must be signed in to change notification settings - Fork 825
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add separate table for Domain Email Addresses
Introduce a new entity type `DomainEmailAddress` as an alternative to the 'from_email_address' option group.
- Loading branch information
Showing
1 changed file
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
<?php | ||
|
||
return [ | ||
'name' => 'DomainEmailAddress', | ||
'table' => 'civicrm_domain_email_address', | ||
'class' => 'CRM_Core_DAO_DomainEmailAddress', | ||
'getInfo' => fn() => [ | ||
'title' => ts('Site Email Address'), | ||
'title_plural' => ts('Site Email Addresses'), | ||
'description' => ts('Return addresses to use for system-generated emails.'), | ||
'log' => TRUE, | ||
'add' => '6.0', | ||
'icon' => 'fa-envelope', | ||
'label_field' => 'display_name', | ||
'search_fields' => ['display_name', 'email'], | ||
], | ||
'getPaths' => fn() => [], | ||
'getIndices' => fn() => [ | ||
'UI_domain_id_is_default' => [ | ||
'fields' => [ | ||
'domain_id' => TRUE, | ||
'is_default' => TRUE, | ||
], | ||
'unique' => TRUE, | ||
'add' => '6.0', | ||
], | ||
], | ||
'getFields' => fn() => [ | ||
'id' => [ | ||
'title' => ts('ID'), | ||
'sql_type' => 'int unsigned', | ||
'input_type' => 'Number', | ||
'required' => TRUE, | ||
'description' => ts('Email Address ID'), | ||
'add' => '6.0', | ||
'primary_key' => TRUE, | ||
'auto_increment' => TRUE, | ||
], | ||
'display_name' => [ | ||
'title' => ts('Display Name'), | ||
'sql_type' => 'varchar(63)', | ||
'input_type' => 'Text', | ||
'required' => TRUE, | ||
'description' => ts('First and last name of the recipient.'), | ||
'add' => '6.0', | ||
], | ||
'email' => [ | ||
'title' => ts('Email'), | ||
'sql_type' => 'varchar(254)', | ||
'input_type' => 'Email', | ||
'description' => ts('Email address'), | ||
'add' => '6.0', | ||
'input_attrs' => [ | ||
'size' => '30', | ||
], | ||
], | ||
'is_default' => [ | ||
'title' => ts('Default'), | ||
'sql_type' => 'boolean', | ||
'input_type' => 'CheckBox', | ||
'description' => ts('Is this the default email for this domain?'), | ||
'add' => '6.0', | ||
'default' => FALSE, | ||
'input_attrs' => [ | ||
'label' => ts('Default'), | ||
], | ||
], | ||
'description' => [ | ||
'title' => ts('Description'), | ||
'sql_type' => 'text', | ||
'input_type' => 'TextArea', | ||
'localizable' => TRUE, | ||
'description' => ts('Purpose of this email address.'), | ||
'add' => '6.0', | ||
'input_attrs' => [ | ||
'rows' => 8, | ||
'cols' => 60, | ||
], | ||
], | ||
'is_active' => [ | ||
'title' => ts('Enabled'), | ||
'sql_type' => 'boolean', | ||
'input_type' => 'CheckBox', | ||
'description' => ts('Is this email address enabled?'), | ||
'add' => '6.0', | ||
'default' => TRUE, | ||
'input_attrs' => [ | ||
'label' => ts('Enabled'), | ||
], | ||
], | ||
'domain_id' => [ | ||
'title' => ts('Domain ID'), | ||
'sql_type' => 'int unsigned', | ||
'input_type' => 'EntityRef', | ||
'description' => ts('Which Domain is this option value for'), | ||
'add' => '6.0', | ||
'input_attrs' => [ | ||
'label' => ts('Domain'), | ||
], | ||
'pseudoconstant' => [ | ||
'table' => 'civicrm_domain', | ||
'key_column' => 'id', | ||
'label_column' => 'name', | ||
], | ||
'entity_reference' => [ | ||
'entity' => 'Domain', | ||
'key' => 'id', | ||
], | ||
], | ||
], | ||
]; |