keat Posted March 8, 2016 Share Posted March 8, 2016 I'll start a new thread for this, as my other one is flicking from subject to subject. Is there a way to force Plain text email for Admin: Order Recieved. Staff are not getting on well with the HTML version. Even if i switch the email client to plain text, they are only vieweing the HTML email as plain text, so it's still messy. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 8, 2016 Share Posted March 8, 2016 CubeCart does send both the Plain Text as the email's main body, and HTML as a mime attachment. Can we have a screen shot of a Plain Text email displayed in your email client that looks 'messy'. Quote Link to comment Share on other sites More sharing options...
keat Posted March 8, 2016 Author Share Posted March 8, 2016 To be honest, it's the HTML which looks messy. When we recieve the store admin email, it only arrives as HTML, there is no plain text attachment or anything. All we get is HTML. Switching Outlook to view as plain text, doesn't make it any better, besides I've already proven that switching outlook to view as plain text, is only vieweing the HTML version as plain text. The contents configured between my HTML and Plain are slightly different, so I know we are not seeing the PT version. This is why I asked if we could force the PT version and see if it's any easier on the eye. Quote Link to comment Share on other sites More sharing options...
keat Posted March 8, 2016 Author Share Posted March 8, 2016 Using the editor tool, I've made numerous attempts to edit the template to justify left, but as soon as I do, the whole template hangs the cart. (much like it did prior to the REPLACE string) Staff havn't seen this plain text. And they don't like the HTML becuase of the way it's justified, it seems all over the page. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 8, 2016 Share Posted March 8, 2016 There is a factual difference between displaying/reading as plain text the HTML message, and viewing the plain text component of that email message (if there is one). That you are reading a converted HTML content is what the messages in the grey header bar below the toolbar implies. If this is Outlook (or AOL, Yahoo, GMail), there is no possible way to force Outlook to show the plain text component if there is an HTML component available without some surgery to the registry. What we can try to do is program your CubeCart to send all emails to the admin without the HTML component. More later. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 9, 2016 Share Posted March 9, 2016 This took some serious thinking outside the box. The way CubeCart uses the PHPMailer class forces things a bit, and does not permit outside pre-manipulation (as if from a hook). There are two edits and a change to an email address that is required. First, in /classes/mailer.class.php: In CC6010, near line 151, find: $this->AddAddress($mail); Change to: if(substr($mail,0,3) == 'PT|'){$htmlOff = true; $mail = substr($mail,3);} $this->AddAddress($mail); Near line 156, find: $this->AddAddress($email, (isset($contents['to'])) ? $contents['to'] : ''); Change to: if(substr($mail,0,3) == 'PT|'){$htmlOff = true; $mail = substr($mail,3);} $this->AddAddress($email, (isset($contents['to'])) ? $contents['to'] : ''); Then, near lines 196-197, find: $this->Body = $this->_html; $this->AltBody = $this->_text; Change to: if($htmlOff){$this->isHTML(false);$this->Body = $this->_text;$this->AltBody = "";}else{$this->Body = $this->_html;$this->AltBody = $this->_text;} //$this->Body = $this->_html; $this->AltBody = $this->_text; Finally, because the PHPMailer class optimizes the sending of emails, it will put all recipient emails on the To: line of a single email. The changes above test for the presence of any email that starts with PT|, that is, PT|[email protected]. The code will strip off those three characters, so the actual email address used is a legitimate one. But because of this prefix, the Mailer class now will send only the Text version of the email. So, which administrator's email address gets modified? Quote Link to comment Share on other sites More sharing options...
keat Posted March 9, 2016 Author Share Posted March 9, 2016 I'm not sure what you mean "Which Email Address Gets Modified" Incidentally, I set my self up as an admin so I could recieve some emails (for vieweing/testing purposes) and the HTML emails come out perfectly fine on my Android. So what is outlook not doing that the email client on my phone does ? Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 9, 2016 Share Posted March 9, 2016 In a different conversation, I mentioned that the HTML appears centered everywhere. I blamed the HTML rendering engine of my email reader where a table cell is centering its content (an inner table), but the centering effect is cascading into that inner table as well when it shouldn't. An edit in CubeCart's admin, Email Templates, Email Templates tab, 'Default Emails' to remove the centering attribute should fix that. Of the images you posted ealier, I see that this centering effect is still active. Displaying HTML as plain text simply removes all the HTML code formatting, and replaces HTML <br> tags with real line breaks. How the conversion handles text in side-by-side tables is a toss of the dice. "Which email address gets modified" is a question to remind you that one address needs changed. Quote Link to comment Share on other sites More sharing options...
keat Posted March 9, 2016 Author Share Posted March 9, 2016 I did read you reference to the table centering being something to do with align=center, but I can't see this anywhere in the source code for the html. I had assumed you meant in the template for Admin:Order Recieved, but now i see you meant default emails. I'll take a look in to this. Quote Link to comment Share on other sites More sharing options...
keat Posted March 9, 2016 Author Share Posted March 9, 2016 Now I found what you were referring to earlier, I removed that <td align=center>, and guess what, the HTML emails are much much tidier. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 9, 2016 Share Posted March 9, 2016 Don't remove the entire <td> tag, just the align=center attribute. Quote Link to comment Share on other sites More sharing options...
keat Posted March 9, 2016 Author Share Posted March 9, 2016 I did leave <td> intact. Thanks again. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 9, 2016 Share Posted March 9, 2016 Resolved? Quote Link to comment Share on other sites More sharing options...
keat Posted March 10, 2016 Author Share Posted March 10, 2016 I think we could say so. Although unfortunately I never got around to trying Brians code as I finally figured out how to fix the HTML. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 10, 2016 Share Posted March 10, 2016 Will mark as resolved, but if anyone chooses to try Bsmither's code and has issues - it's very easy to take "resolved" off again. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.