summaryrefslogtreecommitdiffstats
path: root/inc/mailer.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/mailer.inc.php')
-rw-r--r--inc/mailer.inc.php14
1 files changed, 5 insertions, 9 deletions
diff --git a/inc/mailer.inc.php b/inc/mailer.inc.php
index 1545e930..b2fb7741 100644
--- a/inc/mailer.inc.php
+++ b/inc/mailer.inc.php
@@ -93,7 +93,7 @@ class Mailer
return preg_replace('/^\* Expire in \d+ ms for.*[\\r\\n]+(?=\* Expire)/m','$1', $this->errlog);
}
- public static function queue(int $configid, array $rcpts, string $subject, string $text)
+ public static function queue(int $configid, array $rcpts, string $subject, string $text): void
{
foreach ($rcpts as $rcpt) {
Database::exec("INSERT INTO mail_queue (rcpt, subject, body, dateline, configid)
@@ -102,7 +102,7 @@ class Mailer
}
}
- public static function flushQueue()
+ public static function flushQueue(): void
{
$list = Database::queryGroupList("SELECT Concat(configid, rcpt, subject) AS keyval,
mailid, configid, rcpt, subject, body, dateline FROM mail_queue
@@ -167,19 +167,15 @@ class Mailer
return self::$configs[$configId] ?? [];
}
- /**
- * @param int $configId
- * @return Mailer|null
- */
- public static function instanceFromConfig(int $configId)
+ public static function instanceFromConfig(int $configId): ?Mailer
{
$config = self::getConfig($configId);
if (empty($config))
return null;
if ($config['ssl'] === 'IMPLICIT') {
- $uri = "smtps://{$config['host']}:${config['port']}";
+ $uri = "smtps://{$config['host']}:{$config['port']}";
} else {
- $uri = "smtp://{$config['host']}:${config['port']}";
+ $uri = "smtp://{$config['host']}:{$config['port']}";
}
return new Mailer($uri, $config['ssl'] === 'EXPLICIT', $config['senderaddress'], $config['username'],
$config['password'], $config['replyto']);