Calling the SendEmail Method
We're going to call a new method named SendEmail, passing it the e-mail address and the message we want to send.
Let's take a look at this method which is defined (you guessed it) in the Utils class.
—TicketConfirm.OnPage—
TicketConfirm.OnPage
ClassMethod OnPage() As %Status
{
&html<<html>
<head>
</head>
<body>>
If ($D(%session.Data("Order"))) {
Do ..CompleteOrder()
Write "Thank you for using Caché Cinema!<br>",!
If ($G(%request.Data("OrderEmail",1)) '= "") {
Do ..SendEmail(%request.Data("OrderEmail",1),
"Your tickets have been ordered")
}
}
Else {
Write "Your order expired before it was completed."
}
&html<</body>
</html>>
Quit $$$OK
}