This topic is locked
[SOLVED]

 undefined function sendEmailByTemplate()

1/4/2021 10:19:13 AM
PHPRunner General questions
bobdutil author


[size="2"]I'm getting this error when clicking on the button. [/size][size="2"]Fatal error: Call to undefined function sendEmailByTemplate() in /buttonhandler.php on line 650.[/size]
[size="2"]When commenting out the sendEmailByTemplate line of code [/size][size="2"]I get the correct $data and $email[/size][size="2"] when [/size][size="2"]placing the variables in the $result text. But when I uncomment the sendEmailbyTemplate and try to send an email I get the error. [/size]
[size="2"]My code in the Button Server Event tab is:[/size]
$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."

Sergey Kornilov admin 1/4/2021

What version of PHPRunner is this?

bobdutil author 1/4/2021



What version of PHPRunner is this?


It's version 10.5(Build 36354x64).

Sergey Kornilov admin 1/4/2021

Thank you.
The correct function name is sendEmailTemplate. We have updated the manual but missed the old spelling in one of events.

bobdutil author 1/4/2021



Thank you.
The correct function name is sendEmailTemplate. We have updated the manual but missed the old spelling in one of events.


Ok, thanks you so much.