Post by clorne » Fri Dec 23, 2011 6:57 pm

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

Active Member

Posts

Joined
Fri Dec 23, 2011 6:03 pm

Post by haydent » Thu Jan 26, 2012 9:10 am

this worked for me thankyou. ive even attached it as a vqmod xml file for 1.5.1.3

User avatar
Active Member

Posts

Joined
Wed Nov 09, 2011 9:50 am
Location - Sydney, Australia

Post by papalopo » Fri Feb 24, 2012 10:31 pm

Thanks a lot. Works for me as well.

Newbie

Posts

Joined
Wed May 18, 2011 9:42 pm

Post by josee225 » Fri Mar 02, 2012 8:45 am

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!

New member

Posts

Joined
Tue Dec 27, 2011 10:42 pm

Post by neweratechnology » Fri Nov 02, 2012 11:27 pm

just keep your logos on store as 239px wide and 100px in height


Posts

Joined
Fri Nov 02, 2012 11:26 pm

Post by djkfunk » Fri Nov 08, 2013 3:23 pm

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

Newbie

Posts

Joined
Thu Sep 15, 2011 10:19 pm
Who is online

Users browsing this forum: Bing [Bot] and 14 guests