Load information into email message. |
[eluser]cdonate[/eluser]
Hy guys. I need to send email messages that have some default text and some strings loaded into it, like $name and $last_name, something like this: Code: message = ' The email message is hardcoded inside my controller, but I would like to put the email message into a text file and load it from the controller. This is working OK, but the $name and $last_name don't get loaded, the message stays Code: Dear '.$name.' '.$last_name.',<br> Is there any way to do this? Load the email message from a file and have the variables chaged? My email function is this: Code: function sendEmailConf($name,$last_name,$email){ Thanks!!!
[eluser]InsiteFX[/eluser]
Code: Email Templates with CodeIgniter
[eluser]Iszuddin Ismail[/eluser]
I would use the view. You simply create a PHP file and store it in /view folder, just like how you would normally create one. And you can use the view and generate the output as a string instead of loading the view. Here's a brief example. Code: // prepare email data for email_body.php view
[eluser]cdonate[/eluser]
Very nice, guys! Thanks for the replies! Helped me a lot!
[eluser]cdonate[/eluser]
Now I'm facing a new issue. My sendEmail function is like this: Code: function sendEmail($nome,$sobrenome,$email,$subject,$emailText){ The $nome, $sobrenome and $email are send direcly from the Database, with a simples get() and then $query->name, $query->last_name and $query->email. The email is totally OK, working very well, but, if any name or last_name have these types of characters: á, à, é, è, etc, those characters get chagend, like: Claudio Donaté is changed to Claudio Donaté. Weird thing is that the email text itseft have a few of these types of characters, and they are working fine. Only the $data that is being parsed is changing. How can I correct this? My email text is as follows: Code: <html> Thanks!
|
Welcome Guest, Not a member yet? Register Sign In |