1
0
Fork 0
mirror of synced 2024-06-18 18:54:55 +12:00

Tests fixed?

This commit is contained in:
Eldad Fux 2020-07-06 00:54:41 +03:00
parent 80ab37625c
commit b0e8dfc583
5 changed files with 26 additions and 14 deletions

View file

@ -19,16 +19,6 @@ Config::setParam('domainVerification', false);
Config::setParam('cookieDomain', 'localhost');
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) {
/** @var Appwrite\Utopia\Request $request */
/** @var Appwrite\Utopia\Response $response */

View file

@ -1189,6 +1189,7 @@ App::post('/v1/account/recovery')
$mails
->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('name', $profile->getAttribute('name', ''))
->setParam('subject', $locale->getText('account.emails.recovery.title'))
@ -1355,6 +1356,7 @@ App::post('/v1/account/verification')
$mails
->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('name', $user->getAttribute('name'))
->setParam('subject', $locale->getText('account.emails.verification.title'))

View file

@ -361,6 +361,7 @@ App::post('/v1/teams/:teamId/memberships')
if (APP_MODE_ADMIN !== $mode) { // No need in comfirmation when in admin mode
$mails
->setParam('event', 'teams.membership.create')
->setParam('from', ($project->getId() === 'console') ? '' : \sprintf($locale->getText('account.emails.team'), $project->getAttribute('name')))
->setParam('recipient', $email)
->setParam('name', $name)
->setParam('subject', \sprintf($locale->getText('account.emails.invitation.title'), $team->getAttribute('name', '[TEAM-NAME]'), $project->getAttribute('name', ['[APP-NAME]'])))

View file

@ -1,5 +1,7 @@
<?php
use Utopia\App;
require_once __DIR__.'/../init.php';
\cli_set_process_title('Mails V1 Worker');
@ -22,13 +24,33 @@ class MailsV1
global $register;
$event = $this->args['event'];
$from = $this->args['from'];
$recipient = $this->args['recipient'];
$name = $this->args['name'];
$subject = $this->args['subject'];
$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->Subject = $subject;
$mail->Body = $body;

View file

@ -60,11 +60,8 @@ services:
depends_on:
- mariadb
- redis
# - smtp
- maildev
- clamav
- influxdb
- telegraf
environment:
- _APP_ENV
- _APP_OPTIONS_ABUSE