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-21282 Improve ordering of click reporting #11099

Merged
merged 1 commit into from
Oct 11, 2017

Conversation

JKingsnorth
Copy link
Contributor

@JKingsnorth JKingsnorth commented Oct 10, 2017

Overview

The list of links on the click report summary, on the mailing overview page, didn't display links in a sensible order.

Before

The links are basically in a random order.

After

The links are ordered from highest clicks to lowest clicks.

Technical Details

Changes to the 'ORDER BY' clause in the SQL that builds the list.


@highfalutin
Copy link
Contributor

Reviewing.

@JKingsnorth
Copy link
Contributor Author

@highfalutin Hope the review went OK, let me know =]

@highfalutin
Copy link
Contributor

The PR works as described, appears safe, and seems like a worthwhile improvement. @eileenmcnaughton, care to merge?

@eileenmcnaughton
Copy link
Contributor

Thanks for the review @highfalutin - I think that is adequate for this change

@eileenmcnaughton eileenmcnaughton merged commit 0aa9b4b into civicrm:master Oct 11, 2017
@highfalutin
Copy link
Contributor

PS, this was the script I used to create a mailing containing links and "send" it (to log file) so I could trigger the link tracking and see the results in the link tracking report. Executed it with cv php:script --user admin create_and_send_mailing_with_links.php.

<?php
if (!defined('CIVICRM_MAIL_LOG')) {
  define('CIVICRM_MAIL_LOG', CIVICRM_TEMPLATE_COMPILEDIR . '/mail.log');
}

civicrm_api3('MailSettings', 'create', array(
  'id' => 1,
  'domain_id' => 1,
  'name' => 'default',
  'is_default' => 1,
  'domain' => "test.civi",
  'localpart' => "test",
));

$mailing_result = civicrm_api3('Mailing', 'create', array(
  'sequential' => 1,
  'name' => "Click tracking report ordering test",
  'subject' => "Click tracking report ordering test",
  'body_text' => "Here is a link to Google: http://google.com. \n" .
  "Here is a link to The New York Times: http://nytimes.com. \n" .
  "And here is one to CiviCRM: http://civicrm.org.\n",
  'url_tracking' => 1,
  'is_completed' => 0,
  'groups' => array('include' => array(4)),
  'api.Mailing.submit' => array(
	  'scheduled_date' => "2017-10-10 12:11:40",
	  'approval_date' => "2017-10-10 12:11:40",
	)
));

$result = civicrm_api3('Job', 'process_mailing', array());
print_r($result);
print CIVICRM_MAIL_LOG;

@JKingsnorth
Copy link
Contributor Author

Thanks, both, and thanks @highfalutin for sharing that snippet!

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.

4 participants