I changed the code to

  • Generate the site logo image html through theme_image. After doing that; the site logo was attached to order confirmation mails instead of just being a link.
  • Not use $base_url, but go through l() and url(). After doing that; my custom_url_rewrite_outbound() implementation was able to influence those links too.
CommentFileSizeAuthor
uc_store-api_token_values.patch1.33 KBPieterDC
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, uc_store-api_token_values.patch, failed testing.

longwave’s picture

After doing that; the site logo was attached to order confirmation mails instead of just being a link.

Does core handle this? Or do you need a contrib mail module for images to be converted to attachments?

PieterDC’s picture

I don't know if it's handled by core. I know I have the mimemail module enabled...
You could try that module if you want the same result and if core doesn't do it already.

longwave’s picture

Aha, http://drupal.org/project/mimemail mentions it in the description, I didn't think core had that functionality.

We cannot use theme('image') here without providing an absolute URL to the image, for users who do not have mimemail installed.

PieterDC’s picture

Ok. That can be fixed. Let's adjust it to

theme('image', url($settings['logo'], array('absolute' => TRUE)));

instead of

theme('image', $settings['logo']);
longwave’s picture

Status: Needs work » Fixed

Committed.

longwave’s picture

Ported the removal of $base_url in [store:link] to 7.x as well.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

AlexisWilke’s picture

Status: Fixed » Active

I recently upgraded my version of Ubercart and the emails do not get the logo of the website anymore.

I noticed as I was upgrading that this code changed:

       // Use a logo; but only if we have one to use.
       if (isset($settings['logo']) && $settings['logo']) {
-        $values['site-logo'] = '<img src="'. url($base_url .'/'. $settings['logo'], array('absolute' => TRUE)) .'" />';
+        $values['site-logo'] = theme('image', $settings['logo']);
       }
       else {
         $values['site-logo'] = '';
       }

And it is the culprit. The theme() function does not use the base URL by default (and assuming you have a logo on your website, the default means never.) Reverting the code back makes it work again.

From what I can see, #4 mentions the fact that theme() does not provide a way to get a full URL. Maybe that works better in D7, but in D6 it breaks the emailed invoices.

Thank you.
Alexis Wilke

(Converting this to a bug since at this point it doesn't work right in my realm)

From duplicate here: #1772856: The store logo does not show up in invoices anymore

Edit: added a link to my original post.

longwave’s picture

Category: task » bug
Priority: Normal » Major
Status: Closed (fixed) » Fixed

Status: Active » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.