CATL-1614: Do not create contacts when filing email#44
Open
CATL-1614: Do not create contacts when filing email#44
Conversation
f8043bd to
7f523b3
Compare
… contacts when filing emails
…ation_disabled_if_no_match
d252e25 to
a54a633
Compare
…eating contact optional
… no matching contact found
…atch option during Inbound Email Processing
a54a633 to
7ae1fc2
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
According to new requirements the administrator should be able to configure whether CiviCRM will create a new contact where a contact does not already exist within the system when filing inbound emails, so that he can ensure that new contacts are not created in the system when filing an email. The email should still be filed, even if no contacts are matched.
To achieve this we added an option to the Mail Account settings (see Mail Accounts page
/civicrm/admin/mailSettings?action=add&reset=1) to change the email to activity processing behavior:Email-to-Activity Processingvalue is selected for Used For? field we need to show an additional checkbox field - Do not create new contacts when filing emails (defaults to unticked).Also:
Before
Without the new option above enabled CiviCRM will process emails as normal i.e. will always create new contacts if no matching contact found.
And Activity Status field label location is not changed:

After
With the new option above enabled CiviCRM will not create new contacts if no matching contact found, but email still will be filed.
Now form looks like this:

Technical Details
To make it work we:
civicrm_mail_settingsdb table -is_contact_creation_disabled_if_no_match. Respective upgrader is added.DAO/MailSettings.phpand schemaMailSettings.xmlfiles to have new field.Form/MailSettings.phpandMailSettings.tpl- to print new field and save the value on form submit.EmailProcessor.phpto handle new field during inbound email processing. This also involved updating theIncoming.phpto make contact creation optional.is_contact_creation_disabled_if_no_matchenabled.