$this->_params = array(
'subject' => 'Hello {contact.display_name}',
'body_text' => "This is {contact.display_name}.\nhttps://civicrm.org\n{domain.address}{action.optOutUrl}",
- 'body_html' => "<p>This is {contact.display_name}.</p><p><a href='https://civicrm.org/'>CiviCRM.org</a></p><p>{domain.address}{action.optOutUrl}</p>",
+ 'body_html' => "<link href='https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700|Zilla+Slab:500,700' rel='stylesheet' type='text/css'><p>This is {contact.display_name}.</p><p><a href='https://civicrm.org/'>CiviCRM.org</a></p><p>{domain.address}{action.optOutUrl}</p>",
'name' => 'mailing name',
'created_id' => $this->_contactID,
'header_id' => '',
// ** Pass 1: Create
$createParams = $this->_params;
- $createParams['groups']['include'] = array($groupIDs['a']);
- $createParams['groups']['exclude'] = array();
- $createParams['mailings']['include'] = array();
- $createParams['mailings']['exclude'] = array();
- $createParams['api.mailing_job.create'] = 1;
+ $createParams['groups']['include'] = [$groupIDs['a']];
+ $createParams['groups']['exclude'] = [];
+ $createParams['mailings']['include'] = [];
+ $createParams['mailings']['exclude'] = [];
+ $createParams['scheduled_date'] = 'now';
$createResult = $this->callAPISuccess('Mailing', 'create', $createParams);
$getGroup1 = $this->callAPISuccess('MailingGroup', 'get', array('mailing_id' => $createResult['id']));
$getGroup1_ids = array_values(CRM_Utils_Array::collect('entity_id', $getGroup1['values']));
$updateParams = $createParams;
$updateParams['id'] = $createResult['id'];
$updateParams['groups']['include'] = array($groupIDs['b']);
- $updateParams['api.mailing_job.create'] = 1;
+ $updateParams['scheduled_date'] = 'now';
$this->callAPISuccess('Mailing', 'create', $updateParams);
$getGroup3 = $this->callAPISuccess('MailingGroup', 'get', array('mailing_id' => $createResult['id']));
$getGroup3_ids = array_values(CRM_Utils_Array::collect('entity_id', $getGroup3['values']));
$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
$url = CRM_Mailing_Event_BAO_TrackableURLOpen::track($dao->queue_id, $dao->url_id);
$this->assertContains('https://civicrm.org', $url);
+
+ // Ensure that Google CSS link is not tracked.
+ $sql = "SELECT id FROM civicrm_mailing_trackable_url where url = 'https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700|Zilla+Slab:500,700'";
+ $this->assertEquals([], CRM_Core_DAO::executeQuery($sql)->fetchAll());
}
/**