store logo in product tell a friend Email

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

store logo in product tell a friend Email

Post by mazhar » Thu Jan 01, 2009 7:05 am

Dow load the attachment containing modified files for this change. Place the user control files into conlib. Then edit the Send Product to Friend.htm file and copy its contents and paste them into the Send Product To Friend Email template of store.

ZLA
Commodore (COMO)
Commodore (COMO)
Posts: 496
Joined: Fri Mar 13, 2009 2:55 pm

Re: store logo in product tell a friend Email

Post by ZLA » Mon Jul 20, 2009 2:33 pm

I tried adding

Code: Select all

<img src="${logoUrl}" />
to an email template but it didn't come through. When I examined the eml file using notepad, it contained this:

Code: Select all

<img src=3D"${logoUrl}" />
Does ${logoUrl} actually work?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: store logo in product tell a friend Email

Post by mazhar » Tue Jul 21, 2009 3:44 am

It was a custom parameter, if you look at the code file before sending the Email I was adding this parameter to Email template's available parameter list, I am taking about following code part

Code: Select all

//Store Logo
                    string logoUrl = Token.Instance.Store.StoreUrl;
                    logoUrl += "App_Themes/"+Page.Theme + "/images/logo.gif";
                    template.Parameters["logoUrl"] = logoUrl;

ZLA
Commodore (COMO)
Commodore (COMO)
Posts: 496
Joined: Fri Mar 13, 2009 2:55 pm

Re: store logo in product tell a friend Email

Post by ZLA » Tue Jul 21, 2009 6:31 am

Doh! :oops:

In that case, couldn't I just use this instead:

Code: Select all

<img src="${Store.StoreUrl}/App_Themes/MyTheme/images/logo.gif" >
Since I want to add this to all of our email templates including those that are triggered automatically, I can't assign a custom parameter or I'd have to manually generate all emails. Hardcoding the name of the theme seems a reasonable compromise. (I assume there's no nVelocity variable for the current page theme, right?)

ZLA
Commodore (COMO)
Commodore (COMO)
Posts: 496
Joined: Fri Mar 13, 2009 2:55 pm

Re: store logo in product tell a friend Email

Post by ZLA » Tue Jul 21, 2009 6:38 am

Is it possible to access the store theme via $Store.Settings.StoreTheme?

ZLA
Commodore (COMO)
Commodore (COMO)
Posts: 496
Joined: Fri Mar 13, 2009 2:55 pm

Re: store logo in product tell a friend Email

Post by ZLA » Wed Jul 22, 2009 2:58 pm

StoreSettings work! To semi-dynamically add store logo to email templates, just include:

Code: Select all

<img src="${store.StoreUrl}App_Themes/${store.Settings.StoreTheme}/images/logo.jpg" />
where you have to specify the actual logo filename and its folder location. But this will work for any instance (Dev, Test or Prod) and any Theme as long as the file name is the same.

For those of us on 7.0.2 or before, here's some sql to add the logo at the top of the email:

Code: Select all

UPDATE ac_EmailTemplates SET
   body = REPLACE(body 
            , '<body>', '<body>' + char(13) + char(10) +
                '<img src="${store.StoreUrl}App_Themes/${store.Settings.StoreTheme}/images/logo.jpg" />' ) 
WHERE body LIKE '%<body>%'

UPDATE ac_EmailTemplates SET
   body = '<img src="${store.StoreUrl}App_Themes/${store.Settings.StoreTheme}/images/logo.jpg" />' + char(13) + char(10) + body
WHERE body NOT LIKE '%<body>%'
There are two statements because the note added by customer or merchant templates are html fragments and don't have any a body tag.

Post Reply