Files
mareike/app/MessageTemplates/Registration/InformAdminAboutNewUserTemplate.php
2026-02-05 00:46:22 +01:00

60 lines
1.4 KiB
PHP

<?php
namespace App\MessageTemplates\Registration;
use App\MessageTemplates\activationCodeTemplate;
use App\MessageTemplates\MessageTemplate;
use App\Models\User;
use App\ValueObjects\EmailAddress;
class InformAdminAboutNewUserTemplate extends MessageTemplate
{
public static function createNew(User $user) : InformAdminAboutNewUserTemplate {
$template = new InformAdminAboutNewUserTemplate();
$template->composeMessage($user);
return $template;
}
public function __construct() {
$this->subject = "Eine Person hat sich auf mareike registriert";
}
public function composeMessage(User $user): void {
$this->message =
<<<HTML
<h1>Eine Person hat sich auf mareike angemeldet</h1>
<p>Soeben hat sich eine neue Person auf mareike angemeldet:</p>
<table>
<tr>
<th>Name:</th>
<td>%1\$s</td>
</tr>
<tr>
<th>Email:</th>
<td>%2\$s</td>
</tr>
<tr>
<th>Stamm:</th>
<td>%3\$s</td>
</tr>
<tr>
<th>Freischaltcode:</th>
<td>%4\$s</td>
</tr>
</table>
<p>
Sollte die Person unberechtigt angemeldet sein, lösche den Account.
</p>
HTML;
$this->message = sprintf($this->message,
$user->getFullname(),
$user->email,
$user->local_group,
$user->activation_token
);
}
}