Skip to content
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

CRM-19016 Order mail processing by contact type to let individuals take precedence #8631

Closed

Conversation

niels-heinemann
Copy link
Contributor

@niels-heinemann niels-heinemann commented Jun 28, 2016

When sending mass mailings some groups may contain organizations and individuals. If a pair of them share the same mail address (let's say »office@school.org«) and deduping is engaged, either the organization or the person will receive the mailing by random. But those emails may differ by token substitutions and thus greeting phrases. The organization would get an impersonal opening like »dear sirs and madams« while the person would get a personal salutation like "Dear Jane Doe". A team like a school's teaching stuff working with a shared email account would know to whom the mail concerns if we could guarantee that the persons get served first.

See Improvement CRM-19016

Although a perfect solution would include a better handling of dýnamicly changing contact type names, I just added a simple order by clause because performance tests with ~200k contacts increased consumed time by factor 10. And "Individual" comes before "Organization" in standard installations.
See line comment.

@@ -520,7 +520,8 @@ public function deliver(&$mailer, $testParams = NULL) {
AND $edTable.id IS null
AND $ebTable.id IS null
AND contact_a.is_opt_out = 0
$aclWhere";
$aclWhere
ORDER BY $contactTable.contact_type";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A solution like
ORDER BY IF($contact.contact_type = 'Individual', 0, 1)
would fit the needs more exactly. But it increases time consumption by factor 10.

Copy link
Contributor

@jitendrapurohit jitendrapurohit Jul 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jenkins test failure seems related. Should be fixed by using the alias(contact_a) instead of $contactTable.

@eileenmcnaughton eileenmcnaughton changed the title Order mail processing by contact type to let individuals take precedence CRM-19016 Order mail processing by contact type to let individuals take precedence Jun 30, 2016
@yashodha yashodha added the master label Jul 1, 2016
@niels-heinemann
Copy link
Contributor Author

Sorry! Used 4.7.6 source code any copied by accident.

colemanw and others added 25 commits September 26, 2016 11:53
removed whitespace
CRM-19412: Add event ID class to additional participant template
…emote_api

Fix CRM-19408: Create extension.getremote API
Responsive width for dashboard columns
CRM-18157 - Make the mail format required
Notably, this includes a test with `recipientIsBob`.

There other tests mostly a sanity check to ensure that I was writing the
test well.
CRM-16876 Ensure that foreign countires are also capitalised when hid…
InnoDB and MyISAM may have different edge-cases in how the default
orderings.  However, for deduping, the order is arbitrary. This
patch makes the test order-insensitive.
monishdeb and others added 6 commits October 12, 2016 16:32
Revert "CRM-19245 - Wrap title and description on manage group page"
CRM-19470 - Notice Fix upon event registration
CRM-19460 - Fix brackets in file uploads
CRM-19486: breaks saved search absolute date
CRM-19179: Set primary location during manual merge
@davejenx
Copy link
Contributor

@nielosz We're reviewing PRs at the Edale code sprint this week. The relevant part of CRM/Mailing/BAO/MailingJob.php appears to have changed since you submitted your PR, presumably this is why checks are now failing. Are you able to amend your changes to work with the current master code? Apologies on behalf of the community for the delay in reviewing and consequent inconvenience.

@niels-heinemann
Copy link
Contributor Author

Messed PR. Will clean tomorrow....

eileenmcnaughton and others added 13 commits October 12, 2016 21:31
CRM-19482 Localization for participant status counted and no counted …
CRM-19338 - Update doc url location
CRM-19479 - Fix php undefined index notices
CRM-17917 - More fixes for D8 installer
NFC extract function in dedupe process
civicrm#9232)

* CRM-19495 Ensure that no dots appear at the bottom of menu links in d8

* Switch to borer: 0 as per suggestion from coleman
CRM-19435: IncludeSmartGroups Option added
@niels-heinemann
Copy link
Contributor Author

Updated branch, but PR seems not recognizing it?!

@niels-heinemann
Copy link
Contributor Author

Closed in favour of PR 9236

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.