Tests fixed?
This commit is contained in:
parent
80ab37625c
commit
b0e8dfc583
10
app/app.php
10
app/app.php
|
@ -19,16 +19,6 @@ Config::setParam('domainVerification', false);
|
||||||
Config::setParam('cookieDomain', 'localhost');
|
Config::setParam('cookieDomain', 'localhost');
|
||||||
Config::setParam('cookieSamesite', Response::COOKIE_SAMESITE_NONE);
|
Config::setParam('cookieSamesite', Response::COOKIE_SAMESITE_NONE);
|
||||||
|
|
||||||
// // Set project mail
|
|
||||||
// $register->get('smtp')
|
|
||||||
// ->setFrom(
|
|
||||||
// App::getEnv('_APP_SYSTEM_EMAIL_ADDRESS', APP_EMAIL_TEAM),
|
|
||||||
// ($project->getId() === 'console')
|
|
||||||
// ? \urldecode(App::getEnv('_APP_SYSTEM_EMAIL_NAME', APP_NAME.' Server'))
|
|
||||||
// : \sprintf(Locale::getText('account.emails.team'), $project->getAttribute('name')
|
|
||||||
// )
|
|
||||||
// );
|
|
||||||
|
|
||||||
App::init(function ($utopia, $request, $response, $console, $project, $user, $locale, $webhooks, $audits, $usage, $clients) {
|
App::init(function ($utopia, $request, $response, $console, $project, $user, $locale, $webhooks, $audits, $usage, $clients) {
|
||||||
/** @var Appwrite\Utopia\Request $request */
|
/** @var Appwrite\Utopia\Request $request */
|
||||||
/** @var Appwrite\Utopia\Response $response */
|
/** @var Appwrite\Utopia\Response $response */
|
||||||
|
|
|
@ -1189,6 +1189,7 @@ App::post('/v1/account/recovery')
|
||||||
|
|
||||||
$mails
|
$mails
|
||||||
->setParam('event', 'account.recovery.create')
|
->setParam('event', 'account.recovery.create')
|
||||||
|
->setParam('from', ($project->getId() === 'console') ? '' : \sprintf($locale->getText('account.emails.team'), $project->getAttribute('name')))
|
||||||
->setParam('recipient', $profile->getAttribute('email', ''))
|
->setParam('recipient', $profile->getAttribute('email', ''))
|
||||||
->setParam('name', $profile->getAttribute('name', ''))
|
->setParam('name', $profile->getAttribute('name', ''))
|
||||||
->setParam('subject', $locale->getText('account.emails.recovery.title'))
|
->setParam('subject', $locale->getText('account.emails.recovery.title'))
|
||||||
|
@ -1355,6 +1356,7 @@ App::post('/v1/account/verification')
|
||||||
|
|
||||||
$mails
|
$mails
|
||||||
->setParam('event', 'account.verification.create')
|
->setParam('event', 'account.verification.create')
|
||||||
|
->setParam('from', ($project->getId() === 'console') ? '' : \sprintf($locale->getText('account.emails.team'), $project->getAttribute('name')))
|
||||||
->setParam('recipient', $user->getAttribute('email'))
|
->setParam('recipient', $user->getAttribute('email'))
|
||||||
->setParam('name', $user->getAttribute('name'))
|
->setParam('name', $user->getAttribute('name'))
|
||||||
->setParam('subject', $locale->getText('account.emails.verification.title'))
|
->setParam('subject', $locale->getText('account.emails.verification.title'))
|
||||||
|
|
|
@ -361,6 +361,7 @@ App::post('/v1/teams/:teamId/memberships')
|
||||||
if (APP_MODE_ADMIN !== $mode) { // No need in comfirmation when in admin mode
|
if (APP_MODE_ADMIN !== $mode) { // No need in comfirmation when in admin mode
|
||||||
$mails
|
$mails
|
||||||
->setParam('event', 'teams.membership.create')
|
->setParam('event', 'teams.membership.create')
|
||||||
|
->setParam('from', ($project->getId() === 'console') ? '' : \sprintf($locale->getText('account.emails.team'), $project->getAttribute('name')))
|
||||||
->setParam('recipient', $email)
|
->setParam('recipient', $email)
|
||||||
->setParam('name', $name)
|
->setParam('name', $name)
|
||||||
->setParam('subject', \sprintf($locale->getText('account.emails.invitation.title'), $team->getAttribute('name', '[TEAM-NAME]'), $project->getAttribute('name', ['[APP-NAME]'])))
|
->setParam('subject', \sprintf($locale->getText('account.emails.invitation.title'), $team->getAttribute('name', '[TEAM-NAME]'), $project->getAttribute('name', ['[APP-NAME]'])))
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Utopia\App;
|
||||||
|
|
||||||
require_once __DIR__.'/../init.php';
|
require_once __DIR__.'/../init.php';
|
||||||
|
|
||||||
\cli_set_process_title('Mails V1 Worker');
|
\cli_set_process_title('Mails V1 Worker');
|
||||||
|
@ -22,13 +24,33 @@ class MailsV1
|
||||||
global $register;
|
global $register;
|
||||||
|
|
||||||
$event = $this->args['event'];
|
$event = $this->args['event'];
|
||||||
|
$from = $this->args['from'];
|
||||||
$recipient = $this->args['recipient'];
|
$recipient = $this->args['recipient'];
|
||||||
$name = $this->args['name'];
|
$name = $this->args['name'];
|
||||||
$subject = $this->args['subject'];
|
$subject = $this->args['subject'];
|
||||||
$body = $this->args['body'];
|
$body = $this->args['body'];
|
||||||
|
|
||||||
$mail = $register->get('smtp'); /* @var $mail \PHPMailer\PHPMailer\PHPMailer */
|
/** @var \PHPMailer\PHPMailer\PHPMailer $mail */
|
||||||
|
$mail = $register->get('smtp');
|
||||||
|
|
||||||
|
// Set project mail
|
||||||
|
/*$register->get('smtp')
|
||||||
|
->setFrom(
|
||||||
|
App::getEnv('_APP_SYSTEM_EMAIL_ADDRESS', APP_EMAIL_TEAM),
|
||||||
|
($project->getId() === 'console')
|
||||||
|
? \urldecode(App::getEnv('_APP_SYSTEM_EMAIL_NAME', APP_NAME.' Server'))
|
||||||
|
: \sprintf(Locale::getText('account.emails.team'), $project->getAttribute('name')
|
||||||
|
)
|
||||||
|
);*/
|
||||||
|
|
||||||
|
$mail->clearAddresses();
|
||||||
|
$mail->clearAllRecipients();
|
||||||
|
$mail->clearReplyTos();
|
||||||
|
$mail->clearAttachments();
|
||||||
|
$mail->clearBCCs();
|
||||||
|
$mail->clearCCs();
|
||||||
|
|
||||||
|
$mail->setFrom(App::getEnv('_APP_SYSTEM_EMAIL_ADDRESS', APP_EMAIL_TEAM), (empty($from) ? \urldecode(App::getEnv('_APP_SYSTEM_EMAIL_NAME', APP_NAME.' Server')) : $from));
|
||||||
$mail->addAddress($recipient, $name);
|
$mail->addAddress($recipient, $name);
|
||||||
$mail->Subject = $subject;
|
$mail->Subject = $subject;
|
||||||
$mail->Body = $body;
|
$mail->Body = $body;
|
||||||
|
|
|
@ -60,11 +60,8 @@ services:
|
||||||
depends_on:
|
depends_on:
|
||||||
- mariadb
|
- mariadb
|
||||||
- redis
|
- redis
|
||||||
# - smtp
|
|
||||||
- maildev
|
|
||||||
- clamav
|
- clamav
|
||||||
- influxdb
|
- influxdb
|
||||||
- telegraf
|
|
||||||
environment:
|
environment:
|
||||||
- _APP_ENV
|
- _APP_ENV
|
||||||
- _APP_OPTIONS_ABUSE
|
- _APP_OPTIONS_ABUSE
|
||||||
|
|
Loading…
Reference in a new issue