58 lines
1.6 KiB
PHP
58 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace com\fwdekker\deathnotifier\mailer;
|
|
|
|
|
|
/**
|
|
* An email to inform a user that a tracked article has been re-created.
|
|
*/
|
|
class NotifyArticleUndeletedEmail extends Email
|
|
{
|
|
/**
|
|
* A string identifying the type of email.
|
|
*/
|
|
public const TYPE = "notify-article-undeleted";
|
|
|
|
/**
|
|
* @var string The name of the article that was re-created.
|
|
*/
|
|
public string $name;
|
|
|
|
|
|
/**
|
|
* Constructs an email to inform a user that a tracked article has been re-created.
|
|
*
|
|
* @param string $recipient the intended recipient of the email
|
|
* @param string $name the name of the article that was re-created
|
|
*/
|
|
public function __construct(string $recipient, string $name)
|
|
{
|
|
$this->type = self::TYPE;
|
|
$this->recipient = $recipient;
|
|
|
|
$this->name = $name;
|
|
$this->arg1 = $name;
|
|
}
|
|
|
|
|
|
public function getSubject(): string
|
|
{
|
|
return "$this->name article has been re-created";
|
|
}
|
|
|
|
public function getBody(array $config): string
|
|
{
|
|
$base_path = $config["server"]["base_path"];
|
|
|
|
return
|
|
"The Wikipedia article about $this->name has been re-created. " .
|
|
"Death Notifier will once again track the article and notify you if $this->name dies." .
|
|
"\n\n" .
|
|
"You are receiving this message because of the preferences in your Death Notifier account. " .
|
|
"To unsubscribe from these messages, go to the Death Notifier website, log in, and change your email " .
|
|
"preferences." .
|
|
"\n\n" .
|
|
$base_path;
|
|
}
|
|
}
|