Skip to content

Commit

Permalink
Alterada a mensagem do e-mail Ref.: #1
Browse files Browse the repository at this point in the history
  • Loading branch information
israelmelo committed Sep 6, 2024
1 parent 3866426 commit 66e0d7c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
13 changes: 11 additions & 2 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,15 +226,24 @@ public function createNotification($recipient, $entity, $spam_detections, $ip)
$translated_field = isset($field_translations[$detection['field']]) ? $field_translations[$detection['field']] : $detection['field'];
$detected_details[] = "Campo: $translated_field, Termos: " . implode(', ', $detection['terms']) . '<br>';
}


$dict_entity = $this->dictEntity($entity, 'artigo');

$mail_notification_message = i::__('O sistema detectou possível spam em um conteúdo recente. Por favor, revise as informações abaixo e tome as medidas necessárias:');
$mail_blocked_message = i::__("O sistema detectou um conteúdo inadequado neste cadastro e moveu-o para a lixeira. Seguem abaixo os dados para análise do conteúdo:");
$mail_message = $is_save ? $mail_notification_message : $mail_blocked_message;

$params = [
"siteName" => $app->siteName,
"nome" => $entity->name,
"id" => $entity->id,
"url" => $entity->singleUrl,
"baseUrl" => $app->getBaseUrl(),
"detectedDetails" => implode("\n", $detected_details),
"ip" => $ip
"ip" => $ip,
"adminName" => $recipient->name,
'mailMessage' => $mail_message,
'dictEntity' => $this->dictEntity($entity, 'none')
];

$mustache = new \Mustache_Engine();
Expand Down
6 changes: 3 additions & 3 deletions views/emails/email-spam.html
Original file line number Diff line number Diff line change
Expand Up @@ -527,12 +527,12 @@
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<p>Olá, administrador.</p>
<p>Olá, {{adminName}}.</p>

<p>O sistema detectou possível spam em um conteúdo recente. Por favor,
revise as informações abaixo e tome as medidas necessárias:</p>
<p>{{mailMessage}}</p>
<div class="status-card">
<h3 class="status-card--title">Detalhes da Detecção</h3>
<p><strong>Tipo:</strong> {{dictEntity}}</p>
<p><strong>Nome:</strong> {{nome}}</p>
<p><strong>ID:</strong> {{id}}</p>
<p><strong>IP:</strong> {{ip}}</p>
Expand Down

0 comments on commit 66e0d7c

Please sign in to comment.