Merge branch 'issue/75'

This commit is contained in:
Phil 2024-09-04 21:43:13 +02:00
commit 79c278170f
2 changed files with 20 additions and 2 deletions

View File

@ -17,12 +17,23 @@ class CRM_Civiproxy_Mailer {
* this is the orginal, wrapped mailer
*/
protected $mailer = NULL;
/**
* @var Mail Driver
*/
protected $driver = NULL;
/**
* @var array Mail Params, currently not used
*/
protected $params = [];
/**
* construct this mailer wrapping another one
*/
public function __construct($mailer) {
public function __construct($mailer, $driver, $params) {
$this->mailer = $mailer;
$this->driver = $driver;
$this->params = $params;
}
/**
@ -81,4 +92,11 @@ class CRM_Civiproxy_Mailer {
$value = preg_replace("#{$system_base}civicrm/mailing/{$function}#i", $new_url, $value);
}
}
/**
* @return Mail|null
*/
public function getDriver() {
return $this->driver;
}
}

View File

@ -15,7 +15,7 @@ require_once 'civiproxy.civix.php';
* so we can mend all the URLs in outgoing emails
*/
function civiproxy_civicrm_alterMailer(&$mailer, $driver, $params) {
$mailer = new CRM_Civiproxy_Mailer($mailer);
$mailer = new CRM_Civiproxy_Mailer($mailer, $driver, $params);
}
/**