Subversion Repositories PEEPS

Rev

Rev 6 | Rev 22 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6 Rev 19
Line 132... Line 132...
132
      print $h->h2 ("Congratulations!");
132
      print $h->h2 ("Congratulations!");
133
      print $h->div ({ style=>"max-width:450px;" }, "You've successfully purchased insurance.", "You're currently covered by policy $policy_id, which has $daysremaining days remaining.", " ");
133
      print $h->div ({ style=>"max-width:450px;" }, "You've successfully purchased insurance.", "You're currently covered by policy $policy_id, which has $daysremaining days remaining.", " ");
134
      print $h->button ({onclick => "window.location.href='/';"}, "Home");
134
      print $h->button ({onclick => "window.location.href='/';"}, "Home");
135
      print $h->close ("BODY", "HTML");
135
      print $h->close ("BODY", "HTML");
136
      logit ($user->{id}, "Successfully renewed insurance.");
136
      logit ($user->{id}, "Successfully renewed insurance.");
-
 
137
      emailConfirmation ($user->{email});
137
      exit;
138
      exit;
138
    } else {
139
    } else {
139
      print $h->h2 ("That's weird!");
140
      print $h->h2 ("That's weird!");
140
      print $h->div ({ style=>"max-width:450px;" }, "It seemed like you successfully purchased insurance, but then there was an issue updating your records. You should probably email peeps\@wftdi.com and tell them to investigate.", " ");
141
      print $h->div ({ style=>"max-width:450px;" }, "It seemed like you successfully purchased insurance, but then there was an issue updating your records. You should probably email peeps\@wftdi.com and tell them to investigate.", " ");
141
      print $h->button ({onclick => "window.location.href='/';"}, "Home");
142
      print $h->button ({onclick => "window.location.href='/';"}, "Home");
Line 154... Line 155...
154
  print $h->button ({onclick => "window.location.href='/';"}, "Home");
155
  print $h->button ({onclick => "window.location.href='/';"}, "Home");
155
  logit ($user->{id}, "ERROR: Something really weird happend during checkout confirmation.");
156
  logit ($user->{id}, "ERROR: Something really weird happend during checkout confirmation.");
156
}
157
}
Line -... Line 158...
-
 
158
 
-
 
159
 
-
 
160
sub emailConfirmation {
-
 
161
  my $target = shift // return;
-
 
162
  my $subject = "WFTDA Insurance Coverage Confirmation";
-
 
163
  my $message = $h->p ($h->br ()).
-
 
164
                $h->p ({ style => "text-align: center;" }, $h->img ({ alt => "", src => "https://peeps.gadell.org/images/wftda-insurance-logo.svg", style => "width: 300px; height: 97px;"})).
-
 
165
                $h->p (
-
 
166
                         $h->br (),
-
 
167
                         ["Greetings", $h->br (), $h->br ()],
-
 
168
                         "Thank you for enrolling in WFTDA Insurance! This email confirms your coverage is in effect for 12 months, please retain it for your records. For additional resources, forms and information, please visit ".$h->a ({ href => "https://wftdi.com" }, "wftdi.com").'.  ',
-
 
169
                         $h->br (),
-
 
170
                         "WFTDA Insurance",
-
 
171
                         $h->br ()
-
 
172
                       );
-
 
173
  
-
 
174
  use PEEPSMailer;
-
 
175
  EmailUser ($target, $subject, $message);
-
 
176