41 lines
1.0 KiB
PHP
41 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace KupShop\KupShopBundle\Email;
|
|
|
|
class ReviewResponseEmail extends BaseEmail
|
|
{
|
|
protected static $name = 'Hodnocení';
|
|
protected static $type = 'REVIEW_RESPONSE';
|
|
protected $subject = 'Vaše hodnocení má odpověď';
|
|
protected $template = 'email/email_review_response.tpl';
|
|
protected static $priority = 0;
|
|
protected $defaultEnabled = 'N';
|
|
|
|
public static function getPlaceholders()
|
|
{
|
|
$placeholders = parent::getPlaceholders();
|
|
|
|
$placeholders[self::$type]['ODPOVED_HODNOCENI'] = [
|
|
'text' => translate('ReviewResponse', 'emails'),
|
|
];
|
|
|
|
return $placeholders;
|
|
}
|
|
|
|
public function testEmail(): array
|
|
{
|
|
return $this->getEmail(
|
|
[
|
|
'ODPOVED_HODNOCENI' => sqlQueryBuilder()->select('response')->from('reviews')->where('response is not null')->setMaxResults(1)->execute()->fetchOne(),
|
|
]
|
|
);
|
|
}
|
|
|
|
public static function isAllowed()
|
|
{
|
|
return findModule(\Modules::REVIEWS);
|
|
}
|
|
}
|