Rev 208 | Blame | Compare with Previous | Last modification | View Log | RSS feed
#!/usr/bin/perluse strict;use cPanelUserConfig;use RollerCon;use tableViewer;use DateTime;use HTML::Tiny;my $h = HTML::Tiny->new( mode => 'html' );my $dt = DateTime->today;my $day = $dt->day_name;my $date = $dt->date;my $year = $dt->year;my $dbh = getDBConnection ();my $DEPT = getDepartments ();my $class_name;my $cnhan = $dbh->prepare ("select id, name from class where year(date) = year(now())");$cnhan->execute ();while (my ($id, $name) = $cnhan->fetchrow_array ()) { $class_name->{$id} = $name; }my $sth2 = $dbh->prepare("select distinct id from v_class_signup_new where year(date) = year(now()) and RCid = ? order by id");my $seminar_name;my $snhan = $dbh->prepare ("select id, name from seminar where year(date) = year(now())");$snhan->execute ();while (my ($id, $name) = $snhan->fetchrow_array ()) { $seminar_name->{$id} = $name; }my $sth3 = $dbh->prepare("select distinct id from v_seminar_signup_new where year(date) = year(now()) and RCid = ? order by id");my $sth1 = $dbh->prepare("select RCid from v_class_signup_new where year(date) = year(now()) and isnull(RCid) = 0 union select RCid from v_seminar_signup_new where year(date) = year(now()) and isnull(RCid) = 0 order by RCid");$sth1->execute();while (my ($RCid) = $sth1->fetchrow_array()) {my $email = getUserEmail($RCid);my $dname = getUserDerbyName($RCid);my @classes = ();$sth2->execute($RCid);while (my ($C) = $sth2->fetchrow_array()) {push @classes, $C;}my @seminars = ();$sth3->execute($RCid);while (my ($S) = $sth3->fetchrow_array()) {push @seminars, $S;}my $message = $h->p ("Greetings $dname,","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"),"Thanks again and see you next year!",);if (scalar @classes) {$message .= $h->p ("Here are the links to review the MVP Classes we have you registered for:");$message .= $h->ul ([ map { $h->li ($h->a ({ href => "https://volunteers.rollercon.com/schedule/survey.pl?classid=$_" }, $class_name->{$_})) } @classes ]);}if (scalar @seminars) {$message .= $h->p ("Here are the links to review the Seminars we have you registered for:");$message .= $h->ul ([ map { $h->li ($h->a ({ href => "https://volunteers.rollercon.com/schedule/seminar_survey.pl?seminarid=$_" }, $seminar_name->{$_})) } @seminars ]);}$message .= $h->p ($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.)"),$h->br,"--RollerCon HQ".$h->br.'rollercon@gmail.com'.$h->br."rollercon.com");# $message .= "\n$hours TOTAL HOURS\n\nAgain, thank you for volunteering at RollerCon.\n\n-RollerCon Leadership Team";my $subject = $dname."'s RollerCon MVP Class and Seminar Surveys";print "Emailing $dname ($email)...\n";use RCMailer;EmailUser($email, $subject, $message);sleep (15);}print "\ndone.\n\n";