Show different logo in signature depending on user

Follow

When working with several companies in one org you probably don't want to show one company's logo in the signature for all users. 

In this article I will explain how you can work with multiple logos and how you can determine which logo should be shown for which user in the signature. 

There are several ways you can configure this in Salesforce. However, I will explain one way in this article.

  • To execute these changes you will need admin rights.
  • If you have never created a field before it is recommended you read the articles concerning this subject first. At the end of this article you can find some useful articles of Salesforce.

First, you will need to create two fields on the User object; a picklist field and a formula field.

Picklist field

With this field you can indicate on the user record which logo should be shown in the signature. You can call this field for example Type of email logo (API name Type_email_logo__c ). The amount of values depends on how many different logos you want to show. In this article we will work with 2 different logos. Thus, 2 values will need to be created; for example: Company 1 and Company 2.

Make sure that this field is added to the page lay out.

Formula field type Text

In this field we have to write the logic of when which logo should be shown. You can name this field Email image (API name Email_image__c) for example.

See below the formula format.

IF(ISPICKVAL(Type_email_logo__c , "Company1"), IMAGE("............................",""), IF(ISPICKVAL(Type_email_logo__c , "Company2"),IMAGE("...................................",""),""))

In this formula we look at the value of the picklist field we created earlier. Based on the value that is selected on the user record an image will be shown in the signature. 

The logos need to be uploaded in Static Resources. You can find this by going to Setup > Build > Develop. It is important that the Cache Control is Public.

For example purposes I named the uploaded images Logo1 and Logo2.

We need the URL of the logo. Open the images > copy the image URL. For example: https://connexys-537--lightfcs8--c.cs87.visual.force.com/resource/1524307528000/Logo2

Between (".........","") the URL of the image needs to be placed with the Site URL. Below you see how the URL needs to be constructed.

It should be: Site URL + /resource/Logo2.

You can find the Site URL in Setup > Build > Develop > Sites. 

My formula is as follows:

IF(ISPICKVAL(Type_email_logo__c , "Company1"), IMAGE("https://lightfcs8-resourcemanagerplatinum-158ce584f60.cs87.force.com//resource/Logo1",""), IF(ISPICKVAL(Type_email_logo__c , "Company2"),IMAGE("https://lightfcs8-resourcemanagerplatinum-158ce584f60.cs87.force.com/resource/Logo2",""),""))

Merge item

The formula field should be added as a merge item. The merge item will be {!user.APIname}. Thus, in my example it will be {!user.Email_image__c}. You will need to add it in the footer in the email template or in Connexys Setup > Application settings > Email message.

Filling the picklist field

If you're configuring this in an org that is already live you have two options to fill the picklist field on the user record.

1. If it's an org with a few users then it is easier to manually select a logo.

2. If it's an org with many users then it's recommended to fill the field with the Data loader based on a recognizable feature that allows you to see to which company the user belongs to.

In the case of new users you will need to select a value manually. 

Test if it works

Finally, send a test email to check if the (correct) logo is showing in the mail.

 

Happy configuring & good luck!

 

Useful articles:

Create Custom Fields

Build a Formula Field

Insert, Update, or Delete Data Using Data Loader


Have more questions? Submit a request

Comments

Powered by Zendesk