What i want to accomplish is:
call a function from a file
that function returns me a variable with the correct html template
pass the return of this function to another function and use it as body in phpMailer.
I have a page request.php where i call getEmailTemplate() from ManageEmailtemplates.php to get the correct html template and store it to variable: $body=getEmailtemplate();
function getEmailTemplate(){
$template='<html><body> html data </body> </html>';
return $template;
}
then i want to pass this variable to another file cls_mailHandler.php and use it as body to email.
function NewRequestMail($template){
.
.
.
.
.
$mail->Body = $template;
$mail->isHTML(true);
}
The problem is that when i try this way my emails sent i can see them on my mobile but on mail client on browser nothing show up(gmail, hotmail...)
If i change this $body=getEmailtemplate(); to this $body="'".getEmailtemplate()."'"; then in hotmail shows up html content with the ' at the beginning and at the end. But gmail nothing.
Is there any specific way that i have to pass html data inside variable and use them?
thank you