Jump to content

Ability to Change Logo per client?


CCSupport

Recommended Posts

Hello,

 

Is there any way of changing the picture that appears on the top of the email/invoice that gets sent to the client on a per client basis?

 

I know this can be done permanently however I want the ability to change the picture per group of clients. Not to change the business name but for instance change the picture if it's a Web Hosting Client compared to Dedicated Hosting Client.

 

I was thinking I could just create a new Email Template however I cannot see a way of changing the picture.

 

Any advice would be appreciated.

Link to comment
Share on other sites

I don't know if this would work, but you could modifying the Global Email Header Content...

 

setup -> general settings -> mail -> Global Email Header Content

 

I think by default it contains the following:

 

<p><a href="{$company_domain}" target="_blank"><img src="{$company_logo_url}" alt="{$company_name}" border="0" /></a></p>

I don't think you can use PHP or Smarty in this box, so one option would be to delete the above and copy & paste it to the start of your email templates...

 

you could then either specify the logo URL in each template, or use {if} statements to change the logo based on the order content... perhaps something along the lines of...

 

{if $service_id eq "1"}
<p><a href="{$company_domain}" target="_blank"><img  src="hosting_logo.png" alt="{$company_name}" border="0" /></a></p>
{else}
{if $service_domain}
<p><a href="{$company_domain}" target="_blank"><img  src="domain_logo.png" alt="{$company_name}" border="0" /></a></p>
{else}
<p><a href="{$company_domain}" target="_blank"><img  src="{$company_logo_url}" alt="{$company_name}" border="0" /></a></p>
{/if}

now you'd have to sort out the path to the logo images, but I think it should work - though you might need to send a few test emails to sort out the options!

 

if your using client groups, then that would make the coding slightly easier...

 

{if $client_group_id eq "1"}
<p><a href="{$company_domain}" target="_blank"><img   src="hosting_logo.png" alt="{$company_name}" border="0" /></a></p>
{else}
{if $client_group_id eq "2"}
<p><a href="{$company_domain}" target="_blank"><img   src="domain_logo.png" alt="{$company_name}" border="0" /></a></p>
{else}
<p><a href="{$company_domain}" target="_blank"><img   src="{$company_logo_url}" alt="{$company_name}" border="0" /></a></p>
{/if}

I think a similar solution might work with the invoice pdf, but that would be much more complicated - it'd have to use PHP to modify the logo if statements and I suspect would also have to query the database to find the user's client group... hmm perhaps you could get around querying the db by adding a custom field mirroring the content of the client group - that field would be passed to the pdf and I think you could use conditional if statements with it...

 

but as I say, this is more complex than modifying the email template - so it might be a good idea to search the forums/appstore to see if anyone has done it.

Link to comment
Share on other sites

  • 8 years later...
On 1/3/2014 at 1:08 PM, brian! said:

<p><a href="{$company_domain}" target="_blank"><img src="{$company_logo_url}" alt="{$company_name}" border="0" /></a></p>

 

 

can't find this in my global email header
i understand this solution is from 2014, is it still compactable with the v8

Link to comment
Share on other sites

  • 2 weeks later...

You might be able to get some traction with a URL for the image source that mentions the group name or ID.  So <img src="{$company_logo_url} above would become something like:

<img src="https://yourwebsite.com/logo/{$client_group_id}.jpg">

Another easy trick would be to make the logo file into a .php file and have that output the appropriate image.  That should be relatively easy, you'd have to pass the group id as a parameter though.  This also makes for easy defaults for new groups and if no group is specified.

Bear in mind that some email services may filter this out (looks spammy), so I'm not certain how well it would work in practice, but it's worth a go.  (If it fails, you could probably also use a .htaccess file to get a .jpg to run as a .php file, so long as you make sure that's in a subfolder; though this is getting well towards evil hacking skills).

Cheers

Brian

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...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated