Subversion Repositories VORC

Rev

Rev 158 | 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;
158 - 14
my $year = $dt->year;
112 - 15
 
16
my $dbh = getDBConnection ();
17
my $DEPT = getDepartments ();
18
 
19
my $class_name;
20
my $cnhan = $dbh->prepare ("select id, name from class where year(date) = year(now())");
21
$cnhan->execute ();
22
while (my ($id, $name) = $cnhan->fetchrow_array ()) { $class_name->{$id} = $name; }
23
 
208 - 24
my $sth1 = $dbh->prepare("select distinct RCid from v_class_signup_new where year(date) = year(now()) order by RCid");
25
my $sth2 = $dbh->prepare("select distinct id from v_class_signup_new where year(date) = year(now()) and RCid = ? order by id");
112 - 26
 
27
$sth1->execute();
28
while (my ($RCid) = $sth1->fetchrow_array()) {
29
	my $email = getUserEmail($RCid);
30
	my $dname = getUserDerbyName($RCid);
31
	my @classes = ();
32
 
33
	$sth2->execute($RCid);
34
	while (my ($C) = $sth2->fetchrow_array()) {
35
		push @classes, $C;
36
	}
37
 
38
	my $message = $h->p ("Greetings $dname,",
158 - 39
	                     "Thanks for taking classes at RollerCon $year. 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"),
112 - 40
	                     "Thanks again and see you next year!",
41
	                     "Here are the links to review the classes that we have you registered for:"
42
	                    );
43
 
44
  $message .= $h->ul ([ map { $h->li ($h->a ({ href => "https://volunteers.rollercon.com/schedule/survey.pl?classid=$_" }, $class_name->{$_})) } @classes ]);
45
 
46
 
47
  $message .= $h->p (
48
    $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.)"),
49
    $h->br,
50
    "--RollerCon HQ".$h->br.'rollercon@gmail.com'.$h->br."rollercon.com"
51
  );
52
 
53
 
54
#	$message .= "\n$hours TOTAL HOURS\n\nAgain, thank you for volunteering at RollerCon.\n\n-RollerCon Leadership Team";
55
 
56
	my $subject = $dname."'s RollerCon MVP Class Surveys";
57
 
58
	print "Emailing $dname ($email)...\n";
59
	use RCMailer;
60
	EmailUser($email, $subject, $message);
61
	sleep (15);
62
}
63
 
158 - 64
print "\ndone.\n\n";