-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsendemailcancelsignup.php
32 lines (23 loc) · 1.03 KB
/
sendemailcancelsignup.php
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
32
<?php
/* Sends an email to a newly un-registered attendee on a session */
function send_email_cancelsignup($webinar, $session_info, $cm, $user) {
global $CFG;
foreach($session_info->sessiondates as $dates) {
$startdatetime = date('d F Y', $dates->timestart) . " at " . date('h:i A', $dates->timestart);
}
$a = new stdClass();
$a->name = $user->firstname . " " . $user->lastname;
$a->starttime = $startdatetime;
$a->webinarname = $webinar->name;
$a->webinarintro = $webinar->description;
$a->webinaragenda = $webinar->agenda;
$a->adminemail = $webinar->adminemail;
//print_r($a);
$subject = get_string('sessionunregistersubject', 'webinar', $a);
$contact = get_string('sessionunregistercontact', 'webinar', $a);
$message = get_string('sessionunregistermessage', 'webinar', $a);
//last task - strip <p> and </p> from the message before we send the email
$message = str_replace('<p>','',$message);
$message = str_replace('</p>','',$message);
email_to_user($user, $contact, $subject, $message);
}