Merge pull request #7470 from appwrite/fix-env-variables-rendering
Follow existing style of code
This commit is contained in:
commit
8cc6bfdb9b
1 changed files with 2 additions and 5 deletions
|
@ -60,14 +60,11 @@ class Mails extends Action
|
||||||
$recipient = $payload['recipient'];
|
$recipient = $payload['recipient'];
|
||||||
$subject = $payload['subject'];
|
$subject = $payload['subject'];
|
||||||
$variables = $payload['variables'];
|
$variables = $payload['variables'];
|
||||||
|
$variables['protocol'] = App::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https';
|
||||||
|
$variables['hostname'] = App::getEnv('_APP_DOMAIN');
|
||||||
$name = $payload['name'];
|
$name = $payload['name'];
|
||||||
$body = $payload['body'];
|
$body = $payload['body'];
|
||||||
|
|
||||||
$protocol = App::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https';
|
|
||||||
$hostname = App::getEnv('_APP_DOMAIN');
|
|
||||||
|
|
||||||
$body = str_replace(['{{protocol}}', '{{hostname}}'], [$protocol, $hostname], $body);
|
|
||||||
|
|
||||||
$bodyTemplate = Template::fromFile(__DIR__ . '/../../../../app/config/locale/templates/email-base.tpl');
|
$bodyTemplate = Template::fromFile(__DIR__ . '/../../../../app/config/locale/templates/email-base.tpl');
|
||||||
$bodyTemplate->setParam('{{body}}', $body);
|
$bodyTemplate->setParam('{{body}}', $body);
|
||||||
foreach ($variables as $key => $value) {
|
foreach ($variables as $key => $value) {
|
||||||
|
|
Loading…
Reference in a new issue