Hi Daniel,
We use 'direction : rtl;' to align texts in the code sometimes.
the solution within the language main file is not affecting email opencart send.
can you point the part in the code that build and send the email so I can try to solve it,
or if you can think of a place I should add 'direction:rtl;' line,
thanks
G
We use 'direction : rtl;' to align texts in the code sometimes.
the solution within the language main file is not affecting email opencart send.
can you point the part in the code that build and send the email so I can try to solve it,
or if you can think of a place I should add 'direction:rtl;' line,
thanks
G
OK, I found the code that deal with emails, and read about mail() function.
the solution is to send the email as HTML so it will be RTL.
the only problem now I cant send $headers to the mail() function.
please take a look at the code I changed and see if you know how can I fix the 3rd row from bottom as for now I get this error:
Fatal error: Call to undefined method Mail::setHeaders() in admin/model/customer/order.php on line 42
I set to bold and italic my additions:
the solution is to send the email as HTML so it will be RTL.
the only problem now I cant send $headers to the mail() function.
please take a look at the code I changed and see if you know how can I fix the 3rd row from bottom as for now I get this error:
Fatal error: Call to undefined method Mail::setHeaders() in admin/model/customer/order.php on line 42
I set to bold and italic my additions:
Code: Select all
$subject = sprintf($language->get('mail_subject'), $this->config->get('config_store'), $order_id);
[b]$message = '<html dir="RTL"><body>';[/b][i][/i]
$message .= $language->get('mail_order') . ' ' . $order_id . "\n";
$message .= $language->get('mail_date_added') . ' ' . date($language->get('date_format_short'), strtotime($query->row['date_added'])) . "\n\n";
$message .= $language->get('mail_order_status') . "\n\n";
$message .= $query->row['status'] . "\n\n";
$message .= $language->get('mail_invoice') . "\n";
$message .= html_entity_decode(HTTP_CATALOG . 'index.php?route=account/invoice&order_id=' . $order_id) . "\n\n";
if (isset($data['comment'])) {
$message .= $language->get('mail_comment') . "\n\n";
$message .= strip_tags(html_entity_decode($data['comment'])) . "\n\n";
}
$message .= $language->get('mail_footer');
[b]$message .= '</html></body>';[/b][i][/i]
[i] $headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
[/i][b][/b]
$mail = new Mail($this->config->get('config_mail_protocol'), $this->config->get('config_smtp_host'), $this->config->get('config_smtp_username'), html_entity_decode($this->config->get('config_smtp_password')), $this->config->get('config_smtp_port'), $this->config->get('config_smtp_timeout'));
$mail->setTo($query->row['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_store'));
$mail->setSubject($subject);
[i]$mail->setHeaders($headers);[/i][b][/b]
$mail->setText($message);
$mail->send();
Hi All,
sorry for bumping this one.
my site is getting more and more traffic lately and I still having problems with aligning the email to the right.
I use Hebrew which is right-to-left language, and I cant align the email to be send with the text aligned to the right (RTL).
I would really appreciate any help with it,
Regards,
G
sorry for bumping this one.
my site is getting more and more traffic lately and I still having problems with aligning the email to the right.
I use Hebrew which is right-to-left language, and I cant align the email to be send with the text aligned to the right (RTL).
I would really appreciate any help with it,
Regards,
G
I think it is going wrong because you have added a <html> and <body> tag after there is already one present (this is because the variable $message is not the start of the message (please correctly if I am wrong, this is a assumption)
If you want a way that is certain to work then use the html email contrib located here:
http://forum.opencart.com/viewtopic.php ... 59&start=0
Here you can find the <html> tag and add the text direction thing at the top and it shouldn't complain.
You could also try <p dir="RTL">...... </p> but I am not sure if text direction can be applied to individual paragraphs, but a few things to try none the less!
If you want a way that is certain to work then use the html email contrib located here:
http://forum.opencart.com/viewtopic.php ... 59&start=0
Here you can find the <html> tag and add the text direction thing at the top and it shouldn't complain.
You could also try <p dir="RTL">...... </p> but I am not sure if text direction can be applied to individual paragraphs, but a few things to try none the less!
New member
Who is online
Users browsing this forum: No registered users and 5 guests