* Bugfix - getting id from hash
* Styling changes, using single quotes as preferred.
* Correcting public link when hashed url is set
* Bugfix : correcting if statement. Public link setting the hash instead of id when 'hashed' setting is on.
* Coding standards changes. Spacing after close parenthesis and space after keyword
'id' => $id,
'return' => 'visibility',
])) === 'Public Pages') {
+
+ // if hash setting is on then we change the public url into a hash
+ $hash = CRM_Mailing_BAO_Mailing::getMailingHash($id);
+ if (!empty($hash)) {
+ $id = $hash;
+ }
+
return CRM_Utils_System::url('civicrm/mailing/view', ['id' => $id], $absolute, NULL, TRUE, TRUE);
}
}
$this->_mailing = new CRM_Mailing_BAO_Mailing();
if (!is_numeric($this->_mailingID)) {
+
+ //lets get the id from the hash
+ $result_id = civicrm_api3('Mailing', 'get', [
+ 'return' => ['id'],
+ 'hash' => $this->_mailingID,
+ ]);
$this->_mailing->hash = $this->_mailingID;
+ $this->_mailingID = $result_id['id'];
}
elseif (is_numeric($this->_mailingID)) {
$this->_mailing->id = $this->_mailingID;