Updated the email

This commit is contained in:
Khushboo Verma 2024-01-10 15:03:36 +05:30
parent b74c7671e8
commit ef88ad6514
3 changed files with 24 additions and 8 deletions

View file

@ -175,6 +175,17 @@
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" style="padding-top: 10px; padding-bottom: 10px; display: inline-block; margin-top: 32px">
<tr>
<td align="center" style="border-radius: 8px; background-color: #FD366E;">
<a rel="noopener" target="_blank" href="{{redirect}}" style="font-size: 14px; font-family: Inter; color: #ffffff; text-decoration: none; border-radius: 8px; padding: 9px 14px; border: 1px solid #FD366E; display: inline-block;">{{buttonText}}</a>
</td>
</tr>
</table>
<p>{{optionUrl}}</p>
<a href="{{redirect}}" target="_blank" style="font-size: 12px; line-height: 100%;">{{redirect}}</a>
<table
style="
padding-top: 32px;

View file

@ -33,8 +33,10 @@
"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",
"emails.webhook.subject": "Your webhook has been stopped",
"emails.webhook.body": "Hello <strong>{{user}}</strong>,<br><br>Your webhook <strong>{{webhook}}</strong> on project <strong>{{project}}</strong> has been stopped after {{attempts}} consecutive failures. <br><br>Webhook URL: <strong>{{url}}</strong><br>Error: <strong>{{error}}</strong> <br><br>For more details, view logs of your webhook in <a href='{{link}}'>Appwrite Console</a>. <br><br>To restore the functionality of your webhook, please take the following steps:<br>1. Debug the webhook to identify and resolve the issue.<br>2. Re-enable the webhook from the project settings page.<br><br>If you need any assistance, please reach out to our team on Discord or using email support.",
"emails.webhook.subject": "Your webhook has been paused",
"emails.webhook.body": "Hello <strong>{{user}}</strong>,<br><br>Your webhook <strong>{{webhook}}</strong> on project <strong>{{project}}</strong> has been paused after {{attempts}} consecutive failures. <br><br>Webhook URL: <strong>{{url}}</strong><br>Error: <strong>{{error}}</strong> <br><br>To restore the functionality of your webhook, please take the following steps:<br>1. Debug the webhook to identify and resolve the issue.<br>2. Re-enable the webhook from the project settings page.<br><br>If you need any assistance, please reach out to our team on Discord or using email support.",
"emails.webhook.buttonText": "View webhook settings",
"emails.webhook.optionUrl": "If the button above doesn't show, use the following link:",
"locale.country.unknown": "Unknown",
"countries.af": "Afghanistan",
"countries.ao": "Angola",

View file

@ -163,17 +163,20 @@ class Webhooks extends Action
$subject = $locale->getText("emails.webhook.subject");
$message = Template::fromFile(__DIR__ . '/../../../../app/config/locale/templates/email-webhook.tpl');
$message
->setParam('{{subject}}', $subject)
->setParam('{{message}}', $locale->getText("emails.webhook.body"));
$body = $message->render();
$protocol = App::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https';
$hostname = App::getEnv('_APP_DOMAIN');
$projectId = $project->getId();
$webhookId = $webhook->getId();
$message = Template::fromFile(__DIR__ . '/../../../../app/config/locale/templates/email-webhook.tpl');
$message
->setParam('{{subject}}', $subject)
->setParam('{{message}}', $locale->getText("emails.webhook.body"))
->setParam('{{redirect}}', $protocol . '://' . $hostname . "/console/project-$projectId/settings/webhooks/$webhookId")
->setParam('{{buttonText}}', $locale->getText("emails.webhook.buttonText"))
->setParam('{{optionUrl}}', $locale->getText("emails.webhook.optionUrl"));
$body = $message->render();
$emailVariables = [
'subject' => $subject,
'user' => $user->getAttribute('name'),