Add notificationservice->sendPollCreationMails

This commit is contained in:
Liquidsoul 2019-04-17 16:50:00 +02:00
parent ad8f8ab22c
commit 8dcea674e8
No known key found for this signature in database
GPG Key ID: 15983D72D696931D
2 changed files with 13 additions and 9 deletions

View File

@ -85,4 +85,16 @@ class NotificationService {
{
return $type >= self::UPDATE_POLL;
}
function sendPollCreationMails($creator_mail, $creator_name, $poll_name, $poll_id, $admin_poll_id) {
$this->smarty->assign('poll_creator_name', Utils::htmlMailEscape($creator_name));
$this->smarty->assign('poll_name', Utils::htmlMailEscape($poll_name));
$this->smarty->assign('poll_url', Utils::getUrlSondage($poll_id));
$message_participants = $this->smarty->fetch('mail/participants_forward_email.html.tpl');
$this->mailService->send($creator_mail, '[' . NOMAPPLICATION . '][' . __('Mail', 'Participant link') . '] ' . __('Generic', 'Poll') . ': ' . $poll_name, $message_participants);
$this->smarty->assign('poll_admin_url', Utils::getUrlSondage($admin_poll_id, true));
$message_admin = $this->smarty->fetch('mail/creation_notification_email.html.tpl');
$this->mailService->send($creator_mail, '[' . NOMAPPLICATION . '][' . __('Mail', 'Message for the author') . '] ' . __('Generic', 'Poll') . ': ' . $poll_name, $message_admin);
}
}

View File

@ -1,9 +1 @@
{__('Mail', "This is the message to forward to the poll participants.")}
<br/>
<br/>
{$poll_creator_name} {__('Mail', 'has just created a poll called')} {$poll_name}
<br/>
{__('Mail', 'Thank you for participating in the poll at the following link')}:
<br/>
<br/>
<a href="{$poll_url}">{$poll_url}</a>
{__('Mail', "This is the message to forward to the poll participants.")}<br/><br/>{$poll_creator_name} {__('Mail', 'has just created a poll called')} {$poll_name}<br/>{__('Mail', 'Thank you for participating in the poll at the following link')}:<br/><br/><a href="{$poll_url}">{$poll_url}</a>