• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sending Emails in Multiple languages

#1
[eluser]Glazz[/eluser]
Hi,

I was wondering how do you guys send multilanguage emails.

I know how to use the language file, but i need to have some variables inside the email messages, i tried using the parser, but no success, because the parser doesn't check passes data for variables.

I don't want to make multiple views, i want to have only 1 view, that holds the html and css and inside that view i hold some vars, like {top} {message} {footer}, but inside message i need to have other variables, that's the problem, i don't know how to make it change the vars..

I know i can use str_replace, but there is another way ?

Thanks in advance Wink

#2
[eluser]Cristian Gilè[/eluser]
Quote:I know how to use the language file, but i need to have some variables inside the email messages, i tried using the parser, but no success, because the parser doesn’t check passes data for variables.

Please, provide your code.

Cristian Gilè

#3
[eluser]Glazz[/eluser]
Hi,

In my controller i have something like this:
Code:
$this->load->library('parser');
        
        $data = array(
            'nome' => 'teste',
            'topo'        => $this->lang->line('email_topo'),
        );

        $email = $this->parser->parse('email_template', $data, true);

View (email_template):
Code:
<html>
<head>
<title>{titulo}</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
<!--
body,td,th {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 9px;
    color: #333;
}
body {
    background-color: #dedede;
}
-->
</style></head>
<body>
{topo}

</body>
</html>

Language file (not all of the file):
Code:
$lang['email_topo'] = 'Exmo(a). Sr(a). {nome},';

Current output:
Exmo(a). Sr(a). {nome},

Expected output:
Exmo(a). Sr(a). teste,


The problem is that i need to have variables in the language lines, maybe i will sprintf or something

#4
[eluser]surfweb[/eluser]
I think I found the error:

change this string in the file Whois.servers.php: .eu|whois.eu|FREE with .eu|whois.eu|AVAILABLE

#5
[eluser]surfweb[/eluser]
Sorry ... I was wrong thread


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.