Image may be NSFW.
Clik here to view.
I'm getting this error when clicking on the button. Fatal error: Call to undefined function sendEmailByTemplate() in /buttonhandler.php on line 650.
When commenting out the sendEmailByTemplate line of code I get the correct $data and $email when placing the variables in the $result text. But when I uncomment the sendEmailbyTemplate and try to send an email I get the error.
My code in the Button Server Event tab is:
$data = array();
while($record = $button->getNextSelectedRecord()) {
$data["fname"] = $record["First Name"];
$data["lname"] = $record["Last Name"];
$email = $record["E-mail Address"];
$file = "vendor_email.htm";
sendEmailByTemplate($email, $file , $data);
}
$result["txt"]="Emails have been sent."
Clik here to view.

When commenting out the sendEmailByTemplate line of code I get the correct $data and $email when placing the variables in the $result text. But when I uncomment the sendEmailbyTemplate and try to send an email I get the error.
My code in the Button Server Event tab is:
$data = array();
while($record = $button->getNextSelectedRecord()) {
$data["fname"] = $record["First Name"];
$data["lname"] = $record["Last Name"];
$email = $record["E-mail Address"];
$file = "vendor_email.htm";
sendEmailByTemplate($email, $file , $data);
}
$result["txt"]="Emails have been sent."