aboutsummaryrefslogtreecommitdiff
path: root/templates/mail/forum_notification.php
blob: dc446496011601e42bd731b0c78d31bd15a2baf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
$seminar = get_object_name($topic['seminar_id'], 'sem');
array_pop($path); // last element is the entry itself

$message = [
   'header' => sprintf(
        _('Im Forum der Veranstaltung **%s** gibt es einen neuen Beitrag unter **%s** von **%s**'),
        $seminar['name'],
        implode(' > ', array_map(function ($p) { return $p['name']; }, $path)),
        $topic['anonymous'] ? _('Anonym') : $topic['author']
    ),
    'title' => $topic['name'] ? '**' . $topic['name'] ."** \n\n" : '',
    'content' => $topic['content'],
    'url' => _('Beitrag im Forum ansehen:') .' '. URLHelper::getURL(
        $GLOBALS['ABSOLUTE_URI_STUDIP']
        . 'dispatch.php/course/forum/index/index/'
        . $topic['topic_id']
        .'?cid='
        . $topic['seminar_id']
        .'&again=yes#'
        . $topic['topic_id']
    )
];

// since we've possibly got a mixup of HTML and Stud.IP markup,
// create a pure HTML message step by step
$htmlMessage = Studip\Markup::markAsHtml(
    implode('<br><br>', array_map('formatReady', $message))
);

echo $htmlMessage;