Page 1 of 1

Order confirmation email - embedded logo issue

Posted: Fri Dec 23, 2011 6:57 pm
by clorne
I have just started to use Opencart (as a possible alternative to Magento).

I have downloaded the latest version 1.5.1.3 and am testing on Unix and Windows servers

One minor issue I found is that the logo is not being included in the order confirmation email.

I changed the "send()" public function in system\library\mail.php

from

Code: Select all

foreach ($this->attachments as $attachment) {
			if (file_exists($attachment['file'])) {
				$handle = fopen($attachment['file'], 'r');
				
				$content = fread($handle, filesize($attachment['file']));
				
				fclose($handle);

				$message .= '--' . $boundary . $this->newline;
				$message .= 'Content-Type: application/octetstream; name="' . basename($attachment['file']) . '"' . $this->newline;
				$message .= 'Content-Transfer-Encoding: base64' . $this->newline;
				$message .= 'Content-Disposition: attachment; filename="' . basename($attachment['filename']) . '"' . $this->newline;
				$message .= 'Content-ID: <' . basename($attachment['filename']) . '>' . $this->newline;
				$message .= 'X-Attachment-Id: ' . basename($attachment['filename']) . $this->newline . $this->newline;
				$message .= chunk_split(base64_encode($content));
			}
		}
to

Code: Select all

foreach ($this->attachments as $attachment) {
			if (file_exists($attachment['file'])) {
				$handle = fopen($attachment['file'], 'r');
                                $fil = basename($attachment['file']);
				$ext = pathinfo($fil, PATHINFO_EXTENSION);

				$content = fread($handle, filesize($attachment['file']));
				
				fclose($handle);

				$message .= '--' . $boundary . $this->newline;
				$message .= 'Content-Type: image/' .$ext . '; name="' . $fil . '"' . $this->newline;
				$message .= 'Content-Transfer-Encoding: base64' . $this->newline;
				$message .= 'Content-Disposition: inline; filename="' . $fil . '"' . $this->newline;
				$message .= 'Content-ID: <' . md5($fil) . '>' . $this->newline;
				$message .= 'X-Attachment-Id: ' . $fil . $this->newline . $this->newline;
				$message .= chunk_split(base64_encode($content));
			}
		}
This seems to work fine. It does seem IMHO that the core file is wrong but it may only be a beginners observation

Re: Order confirmation email - embedded logo issue

Posted: Thu Jan 26, 2012 9:10 am
by haydent
this worked for me thankyou. ive even attached it as a vqmod xml file for 1.5.1.3

Re: Order confirmation email - embedded logo issue

Posted: Fri Feb 24, 2012 10:31 pm
by papalopo
Thanks a lot. Works for me as well.

Re: Order confirmation email - embedded logo issue

Posted: Fri Mar 02, 2012 8:45 am
by josee225
Is there any way to modify this file to include a different logo? In my design, I have a withe .png logo on a dark background. Therefore, I would like to use a black logo for the emails.

Thanks!

Re: Order confirmation email - embedded logo issue

Posted: Fri Nov 02, 2012 11:27 pm
by neweratechnology
just keep your logos on store as 239px wide and 100px in height

Re: Order confirmation email - embedded logo issue

Posted: Fri Nov 08, 2013 3:23 pm
by djkfunk
Thanks a lot Clorne and Haydent, working for 1.5.6! I've been racking my brain for hours trying to figure this issue out...I even tried a direct url link to the logo but couldn't get my store logo to show in the order confirmation emails...installed the vqmod and it worked instantly...thanks again