pluginDescription;
}
public function textPopup(): void
{
$text = '
';
echo $text;
}
public function replaceContent(object &$email): void
{
$extractedTags = $this->pluginHelper->extractTags($email, 'date');
if (empty($extractedTags)) {
return;
}
$tags = [];
foreach ($extractedTags as $i => $oneTag) {
if (isset($tags[$i])) {
continue;
}
$time = time();
if (!empty($oneTag->senddate) && !empty($email->sending_date)) {
$time = strtotime($email->sending_date);
}
if (!empty($oneTag->add)) {
$time += intval($oneTag->add);
}
if (!empty($oneTag->remove)) {
$time -= intval($oneTag->remove);
}
if (empty($oneTag->id) || is_numeric($oneTag->id)) {
$oneTag->id = acym_translation('ACYM_DATE_FORMAT_LC'.$oneTag->id);
}
$oneTag->id = str_replace(
['%A', '%d', '%B', '%m', '%Y', '%y', '%H', '%M', '%S', '%a', '%I', '%p', '%w'],
['l', 'd', 'F', 'm', 'Y', 'y', 'H', 'i', 's', 'D', 'h', 'a', 'w'],
$oneTag->id
);
$tags[$i] = acym_date($time, $oneTag->id, true);
}
$this->pluginHelper->replaceTags($email, $tags);
}
}