Subversion Repositories VORC

Rev

Rev 112 | Rev 158 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
112 - 1
#!/usr/bin/perl
2
 
3
use strict;
4
use cPanelUserConfig;
5
use RollerCon;
6
use tableViewer;
7
use DateTime;
8
use HTML::Tiny;
9
my $h = HTML::Tiny->new( mode => 'html' );
10
 
11
my $dt = DateTime->today;
12
my $day = $dt->day_name;
13
my $date = $dt->date;
14
 
15
my $dbh = getDBConnection ();
16
my $DEPT = getDepartments ();
17
 
18
my $class_name;
19
my $cnhan = $dbh->prepare ("select id, name from class where year(date) = year(now())");
20
$cnhan->execute ();
21
while (my ($id, $name) = $cnhan->fetchrow_array ()) { $class_name->{$id} = $name; }
22
 
23
my $sth1 = $dbh->prepare("select distinct RCid from v_class_signup where year(date) = year(now()) order by RCid");
24
my $sth2 = $dbh->prepare("select distinct id from v_class_signup where year(date) = year(now()) and RCid = ? order by id");
25
 
26
$sth1->execute();
27
while (my ($RCid) = $sth1->fetchrow_array()) {
28
	my $email = getUserEmail($RCid);
29
	my $dname = getUserDerbyName($RCid);
30
	my @classes = ();
31
 
32
	$sth2->execute($RCid);
33
	while (my ($C) = $sth2->fetchrow_array()) {
34
		push @classes, $C;
35
	}
36
 
37
	my $message = $h->p ("Greetings $dname,",
38
	                     "Thanks for taking classes at RollerCon 2023. Please take a minute to give us some feedback on the class(es) you took. To find out more about how we use this info, check out ".$h->a ({ href => "https://rollercon.com/about/mvp-star-ratings/" }, "RollerCon MVP Star Ratings"),
39
	                     "Thanks again and see you next year!",
40
	                     "Here are the links to review the classes that we have you registered for:"
41
	                    );
42
 
43
  $message .= $h->ul ([ map { $h->li ($h->a ({ href => "https://volunteers.rollercon.com/schedule/survey.pl?classid=$_" }, $class_name->{$_})) } @classes ]);
44
 
45
 
46
  $message .= $h->p (
47
    $h->i ("(Note: We may be missing some 'walk up' attendees of some classes.  If you don't see a link to a class you took, that's ok.)"),
48
    $h->br,
49
    "--RollerCon HQ".$h->br.'rollercon@gmail.com'.$h->br."rollercon.com"
50
  );
51
 
52
 
53
#	$message .= "\n$hours TOTAL HOURS\n\nAgain, thank you for volunteering at RollerCon.\n\n-RollerCon Leadership Team";
54
 
55
	my $subject = $dname."'s RollerCon MVP Class Surveys";
56
 
57
	print "Emailing $dname ($email)...\n";
58
	use RCMailer;
59
	EmailUser($email, $subject, $message);
60
	sleep (15);
61
}
62
 
63
print "\ndone.\n\n";