X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=CRM%2FMailing%2FBAO%2FMailing.php;h=42c3281e6fa0eec8cd8cc16e639e8e8184255385;hb=6e7a0954a880cf1f6fc7c88ecb976366dba365b6;hp=a1ad4c8392a8605017be88b36182d972e21a4c1a;hpb=c735fb7e38514eb6d7732ffb11ac21ac33e570b9;p=civicrm-core.git
diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php
index a1ad4c8392..42c3281e6f 100644
--- a/CRM/Mailing/BAO/Mailing.php
+++ b/CRM/Mailing/BAO/Mailing.php
@@ -689,6 +689,7 @@ class CRM_Mailing_BAO_Mailing extends CRM_Mailing_DAO_Mailing {
$this->templates['subject'] = implode("\n", $template);
}
+ $this->templates['mailingID'] = $this->id;
CRM_Utils_Hook::alterMailContent($this->templates);
}
return $this->templates;
@@ -1139,8 +1140,8 @@ ORDER BY civicrm_email.is_bulkmail DESC
// push the tracking url on to the html email if necessary
if ($this->open_tracking && $html) {
- array_push($html, "\n" . '"
+ array_push($html, "\n" . ''
);
}
@@ -1514,7 +1515,9 @@ ORDER BY civicrm_email.is_bulkmail DESC
*
* @return object
* $mailing The new mailing object
- * @throws \Exception
+ *
+ * @throws \CRM_Core_Exception
+ * @throws \CiviCRM_API3_Exception
*/
public static function create(&$params, $ids = []) {
@@ -1546,8 +1549,7 @@ ORDER BY civicrm_email.is_bulkmail DESC
$domain_name = 'EXAMPLE.ORG';
}
if (!isset($params['created_id'])) {
- $session =& CRM_Core_Session::singleton();
- $params['created_id'] = $session->get('userID');
+ $params['created_id'] = CRM_Core_Session::getLoggedInContactID();
}
$defaults = [
// load the default config settings for each