mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
Merge branch 'main' into update-acct-api-reference
This commit is contained in:
commit
e030ec6e3e
3 changed files with 14 additions and 22 deletions
|
|
@ -4,7 +4,9 @@
|
||||||
<table border="0" cellspacing="0" cellpadding="0" style="padding-top: 10px; padding-bottom: 10px; display: inline-block;">
|
<table border="0" cellspacing="0" cellpadding="0" style="padding-top: 10px; padding-bottom: 10px; display: inline-block;">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center" style="border-radius: 8px; background-color: #ffffff;">
|
<td align="center" style="border-radius: 8px; background-color: #ffffff;">
|
||||||
<p style="text-align: start; font-size: 14px; font-family: Inter; color: #414146; text-decoration: none; border-radius: 8px; padding: 32px; border: 1px solid #EDEDF0; display: inline-block; word-break: break-word;">{{error}}</p>
|
<p style="text-align: start; font-size: 14px; font-family: Inter; color: #414146; text-decoration: none; border-radius: 8px; padding: 32px; border: 1px solid #EDEDF0; display: inline-block; word-break: break-word;">
|
||||||
|
{{error}}
|
||||||
|
</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,12 @@
|
||||||
"emails.invitation.footer": "If you are not interested, you can ignore this message.",
|
"emails.invitation.footer": "If you are not interested, you can ignore this message.",
|
||||||
"emails.invitation.thanks": "Thanks",
|
"emails.invitation.thanks": "Thanks",
|
||||||
"emails.invitation.signature": "{{project}} team",
|
"emails.invitation.signature": "{{project}} team",
|
||||||
|
"emails.certificate.subject": "Certificate failure for %s",
|
||||||
|
"emails.certificate.hello": "Hello",
|
||||||
|
"emails.certificate.body": "Certificate for your domain '{{domain}}' could not be generated. This is attempt no. {{attempt}}, and the failure was caused by: {{error}}",
|
||||||
|
"emails.certificate.footer": "Your previous certificate will be valid for 30 days since the first failure. We highly recommend investigating this case, otherwise your domain will end up without a valid SSL communication.",
|
||||||
|
"emails.certificate.thanks": "Thanks",
|
||||||
|
"emails.certificate.signature": "{{project}} team",
|
||||||
"sms.verification.body": "{{secret}}",
|
"sms.verification.body": "{{secret}}",
|
||||||
"locale.country.unknown": "Unknown",
|
"locale.country.unknown": "Unknown",
|
||||||
"countries.af": "Afghanistan",
|
"countries.af": "Afghanistan",
|
||||||
|
|
|
||||||
|
|
@ -439,40 +439,24 @@ class Certificates extends Action
|
||||||
|
|
||||||
$locale = new Locale(System::getEnv('_APP_LOCALE', 'en'));
|
$locale = new Locale(System::getEnv('_APP_LOCALE', 'en'));
|
||||||
|
|
||||||
// Send mail to administratore mail
|
// Send mail to administrator mail
|
||||||
$template = Template::fromFile(__DIR__ . '/../../../../app/config/locale/templates/email-certificate-failed.tpl');
|
$template = Template::fromFile(__DIR__ . '/../../../../app/config/locale/templates/email-certificate-failed.tpl');
|
||||||
$template->setParam('{{domain}}', $domain);
|
$template->setParam('{{domain}}', $domain);
|
||||||
$template->setParam('{{error}}', \nl2br($errorMessage));
|
$template->setParam('{{error}}', \nl2br($errorMessage));
|
||||||
$template->setParam('{{attempts}}', $attempt);
|
$template->setParam('{{attempts}}', $attempt);
|
||||||
|
$body = $template->render();
|
||||||
// TODO: Use setbodyTemplate once #7307 is merged
|
|
||||||
$subject = 'Certificate failed to generate';
|
|
||||||
$body = Template::fromFile(__DIR__ . '/../../../../app/config/locale/templates/email-base-styled.tpl');
|
|
||||||
|
|
||||||
$subject = \sprintf($locale->getText("emails.certificate.subject"), $domain);
|
|
||||||
|
|
||||||
$message = Template::fromFile(__DIR__ . '/../../../../app/config/locale/templates/email-inner-base.tpl');
|
|
||||||
$message
|
|
||||||
->setParam('{{body}}', $locale->getText("emails.certificate.body"), escapeHtml: false)
|
|
||||||
->setParam('{{hello}}', $locale->getText("emails.certificate.hello"))
|
|
||||||
->setParam('{{footer}}', $locale->getText("emails.certificate.footer"))
|
|
||||||
->setParam('{{thanks}}', $locale->getText("emails.certificate.thanks"))
|
|
||||||
->setParam('{{signature}}', $locale->getText("emails.certificate.signature"));
|
|
||||||
$body = $message->render();
|
|
||||||
|
|
||||||
$emailVariables = [
|
$emailVariables = [
|
||||||
'direction' => $locale->getText('settings.direction'),
|
'direction' => $locale->getText('settings.direction'),
|
||||||
'domain' => $domain,
|
|
||||||
'error' => '<br><pre>' . $errorMessage . '</pre>',
|
|
||||||
'attempt' => $attempt,
|
|
||||||
'project' => 'Console',
|
|
||||||
'redirect' => 'https://' . $domain,
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$subject = \sprintf($locale->getText("emails.certificate.subject"), $domain);
|
||||||
|
|
||||||
$queueForMails
|
$queueForMails
|
||||||
->setSubject($subject)
|
->setSubject($subject)
|
||||||
->setBody($body)
|
->setBody($body)
|
||||||
->setName('Appwrite Administrator')
|
->setName('Appwrite Administrator')
|
||||||
|
->setbodyTemplate(__DIR__ . '/../../../../app/config/locale/templates/email-base-styled.tpl')
|
||||||
->setVariables($emailVariables)
|
->setVariables($emailVariables)
|
||||||
->setRecipient(System::getEnv('_APP_EMAIL_CERTIFICATES', System::getEnv('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS')))
|
->setRecipient(System::getEnv('_APP_EMAIL_CERTIFICATES', System::getEnv('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS')))
|
||||||
->trigger();
|
->trigger();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue