Answer the question
In order to leave comments, you need to log in
How to insert html email template into code?
There is a code for automatically sending a letter from the site. And how to insert html template into this code. To make writing beautiful.
function RecoveryPassword($user, $pass, $mail){
$text.= "Данные для входа в личный кабинет пользователя: <BR />";
$text.= "<b>Логин:</b> {$user}<BR />";
$text.= "<b>Пароль:</b> {$pass}<BR />";
$text.= "Ссылка для входа в кабинет: <a href='http://".$this->Hosts."/signin'>http://".$this->Hosts."/signin</a>";
$subject = "Восстановление забытого пароля в системе \"".$this->Hosts."\"";
return $this->SendMail($mail, $subject, $text);
}
Answer the question
In order to leave comments, you need to log in
In general, judging by $this->Hosts
the first you have "type oop", since it seems to be objects, but it seems that the codestyle of the curve and in the model (?) / controller (?) some kind of horseradish forgot html ... therefore it would be correct create a layout and a view for a letter, change the current object's View object's layout to a mail one, and render the view into a variable. But it will be easier for you like this:
1) Find a template
2)
function RecoveryPassword($user, $pass, $mail){
ob_start();?>
код шаблона, со вставленными в нужные места значениями через <?=$value?>
<?php
$text = ob_get_clean();
$subject = "Восстановление забытого пароля в системе \"".$this->Hosts."\"";
return $this->SendMail($mail, $subject, $text);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question