Skip to content

Commit

Permalink
Merge pull request #13392 from PeaceWorksTechnologySolutions/master
Browse files Browse the repository at this point in the history
dev/mail#32 - Making mailing test email non-case-sensitive
  • Loading branch information
eileenmcnaughton authored Jan 3, 2019
2 parents 44e82e1 + 291dfe4 commit 75d01ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/v3/Mailing.php
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ function civicrm_api3_mailing_send_test($params) {
$testEmailParams['scheduled_date'] = CRM_Utils_Date::processDate(date('Y-m-d'), date('H:i:s'));
$job = civicrm_api3('MailingJob', 'create', $testEmailParams);
$testEmailParams['job_id'] = $job['id'];
$testEmailParams['emails'] = array_key_exists('test_email', $testEmailParams) ? explode(',', $testEmailParams['test_email']) : NULL;
$testEmailParams['emails'] = array_key_exists('test_email', $testEmailParams) ? explode(',', strtolower($testEmailParams['test_email'])) : NULL;
if (!empty($params['test_email'])) {
$query = CRM_Utils_SQL_Select::from('civicrm_email e')
->select(array('e.id', 'e.contact_id', 'e.email'))
Expand Down
3 changes: 2 additions & 1 deletion tests/phpunit/api/v3/MailingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,9 @@ public function testMailerSendTest_email() {

$mail = $this->callAPISuccess('mailing', 'create', $this->_params);

$params = array('mailing_id' => $mail['id'], 'test_email' => 'alice@example.org', 'test_group' => NULL);
$params = array('mailing_id' => $mail['id'], 'test_email' => 'ALicE@example.org', 'test_group' => NULL);
// Per https://lab.civicrm.org/dev/core/issues/229 ensure this is not passed through!
// Per https://lab.civicrm.org/dev/mail/issues/32 test non-lowercase email
$params['id'] = $mail['id'];
$deliveredInfo = $this->callAPISuccess($this->_entity, 'send_test', $params);
$this->assertEquals(1, $deliveredInfo['count']); // verify mail has been sent to user by count
Expand Down

0 comments on commit 75d01ce

Please sign in to comment.