diff --git a/app/classes/Framadate/Services/NotificationService.php b/app/classes/Framadate/Services/NotificationService.php index 02a74e49909c24cbecc6213668b3b8df8b8214ae..aca76c3badc65ce1b92590f708267a3b62043b25 100644 --- a/app/classes/Framadate/Services/NotificationService.php +++ b/app/classes/Framadate/Services/NotificationService.php @@ -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); + } } diff --git a/tpl/mail/participants_forward_email.html.tpl b/tpl/mail/participants_forward_email.html.tpl index 1df4544810e7557885dbcc4a108d34fa5b6fda66..dc8c3cf9d9ac4dc2d2ee21c269eef9a4200837a5 100644 --- a/tpl/mail/participants_forward_email.html.tpl +++ b/tpl/mail/participants_forward_email.html.tpl @@ -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>