Jump to content

[Resolved] Force Plain text


keat

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

messy.jpg

messy2.jpg

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...