mirror of
https://github.com/openvk/chandler.git
synced 2025-04-01 05:54:00 +03:00
Merge branch 'master' into pro
# Conflicts: # composer.lock
This commit is contained in:
commit
b73cd94d54
4 changed files with 456 additions and 2045 deletions
|
@ -3,11 +3,31 @@ namespace Chandler\Email;
|
|||
use Swift_SmtpTransport;
|
||||
use Swift_Message;
|
||||
use Swift_Mailer;
|
||||
use Postmark\PostmarkClient;
|
||||
|
||||
class Email
|
||||
{
|
||||
static function send(string $to, string $subject, string $html)
|
||||
{
|
||||
if(isset(CHANDLER_ROOT_CONF["email"]["postmark"])) {
|
||||
return (new PostmarkClient(CHANDLER_ROOT_CONF["email"]["postmark"]["key"]))->sendEmail(
|
||||
CHANDLER_ROOT_CONF["email"]["postmark"]["user"],
|
||||
$to,
|
||||
$subject,
|
||||
$html,
|
||||
strip_tags($html),
|
||||
NULL,
|
||||
true,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
["Sensitivity" => "Company-Confidential"],
|
||||
NULL,
|
||||
"None",
|
||||
NULL,
|
||||
CHANDLER_ROOT_CONF["email"]["postmark"]["stream"]
|
||||
);
|
||||
} else {
|
||||
$transport = new Swift_SmtpTransport(CHANDLER_ROOT_CONF["email"]["host"], CHANDLER_ROOT_CONF["email"]["port"], "ssl");
|
||||
$transport->setUsername(CHANDLER_ROOT_CONF["email"]["addr"]);
|
||||
$transport->setPassword(CHANDLER_ROOT_CONF["email"]["pass"]);
|
||||
|
@ -22,3 +42,4 @@ class Email
|
|||
return $mailer->send($message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -149,6 +149,11 @@ class Router
|
|||
$tpl = str_replace($dir, $this->scope["_templatePath"], $tpl);
|
||||
}
|
||||
|
||||
if(!file_exists($tpl)) {
|
||||
trigger_error("Could not open $tpl as template, falling back.", E_USER_NOTICE);
|
||||
$tpl = "$presenterName/$action.xml";
|
||||
}
|
||||
|
||||
$output = $this->delegateView($tpl, $presenter);
|
||||
|
||||
$presenter->onAfterRender();
|
||||
|
|
|
@ -23,9 +23,11 @@
|
|||
"nette/safe-stream": "^2.4",
|
||||
"nette/tokenizer": "^3.1",
|
||||
"firebase/php-jwt": "^5.0",
|
||||
"tracy/tracy": "^2.7",
|
||||
"symfony/translation": "^5.0",
|
||||
"symfony/yaml": "^5.3"
|
||||
"symfony/yaml": "^5.3",
|
||||
"guzzlehttp/guzzle": "^6.0",
|
||||
"wildbit/postmark-php": "^4.0",
|
||||
"tracy/tracy": "2.9"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9.5"
|
||||
|
|
2399
composer.lock
generated
2399
composer.lock
generated
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue