Insert Document Type Translation of Email Communication Templates in Salesforce for BMC Remedyforce BMC Remedyforce Virginia Leandro 16 June 2014
Table of Contents Email Communication Templates 3 Clone an Out of the Box Remedyforce Visualforce Email Communication Template 4 Custom Labels 5 Testing 8 Enabling Translation Workbench 9 PAGE 1 OF 11
Document Information Version: 1.0 Created by: Virginia Leandro Last Modified on: 16 June 2014 Modified by: Virginia Leandro PAGE 2 OF 11
Email Communication Templates A mail merge is the process of generating form letters and other Microsoft Word documents that are personalized for the recipient, who is often a contact or lead or in the case of BMC Remedyforce, a Client or an Initiator. The content of each document is predefined in a mail merge template. Mail merge templates include variables called merge fields where data from your Salesforce records for example a client's name and address displays in the generated document. The forms in Salesforce that utilize this merge functionality are called Email Communication Templates and they let you define an email template and then using merge codes, allow you to pull data from Salesforce and communicate to your client via a form email. You can create four different types of email templates: Text - All users can create or change text email templates. See Creating Text Email Templates. HTML with letterhead - Administrators and users with the Edit HTML Templates permission can create HTML email templates based on a letterhead. See Creating HTML Email Templates. Custom HTML - Administrators and users with the Edit HTML Templates permission can create custom HTML email templates without using a letterhead. You must either know HTML or obtain the HTML code to insert in your email template. See Creating Custom HTML Email Templates. Visualforce - Administrators and developers can create templates using Visualforce. Visualforce email templates allow for advanced merging with a recipient's data, where the content of a template can contain information from multiple records. See Creating Visualforce Email Templates. Since Visualforce is the only Email Template that can support translations, that will be the focus of this document. However, we will not be covering all the nuances of Visualforce as that is outside the scope of this document. The scope of this document is to walk you through cloning an out of the box Visualforce template, making changes so the template can support multiple-languages, and finally how to find, replace or create the necessary translations. PAGE 3 OF 11
Clone an Out of the Box Remedyforce Visualforce Email Communication Template 1. In Salesforce navigate to Setup Communication Templates Email Templates. 2. Find the Email Template Service Request Created and click on its name. Remember, that Salesforce only supports the translation of Visualforce email templates. If you have another template that is NOT Visualforce, it ll first need to be recreated with Visualforce. Again, that s outside the scope of this document. 3. Click Clone and provide a new Email Template Name and a new Template Unique Name. In our example, we append BMC to the beginning of each field. 4. Click Save. 5. Click Edit Template. 6. In the very first line, scroll all the way to the end of the line and add the following: language= {!recipient.languagelocalekey} The complete line will now look like this: <messaging:emailtemplate subject="service Request #(Ref:IN:{!relatedto.Name}) has been created" recipienttype="user" relatedtotype="bmcservicedesk Incident c" language="{!receipient.languagelocalekey"> PAGE 4 OF 11
This is the first step.but there are still additional steps to go as we need to either switch out items or create new label items and translate them for use within the Email Template. Custom Labels Custom labels allow you to create and translate labels within Salesforce. For our example, we ll focus on a couple of labels that we provide out of the box and how you can use our labels (which are already translated out of the box for English, French, German, Spanish, and Japanese) and we ll focus on creating custom labels. If we look back at our template, we ll find that in that first line we set the Subject of the email: subject="service Request #(Ref:IN:{!relatedto.Name}) has been created So we re focusing on building out Service Request #(Ref:IN:{!relatedto.Name}) has been created 1. In a new browser tab, navigate to Salesforce Setup Create Custom Labels. 2. Click the Value column so that all of the translated test is in alphabetical order. We re now going to look for Service Request so click on S to jump to the S Values. 3. Click Next Page until you find Service Request. There will be two: ServiceRequestLabel SSHelpRequest For this example, we re going to use ServiceRequestLabel. Copy the Label Name. 4. Back in your Visualforce Email Template (BMC Service Request Created), we re going to replace the words Service Request with the merge field for the BMC Remedyforce custom label ServiceRequestLabel. Looking at just the subject, replace Service Request with {!$Label.BMCServiceDesk ServiceRequestLabel} The subject should now look like this: subject="{!$label.bmcservicedesk ServiceRequestLabel} #(Ref:IN:{!relatedto.Name}) has been created" Next let s see if Remedyforce has a translation for has been created. 5. Switching back to Custom Labels, click H to get to all the values that begin with H. PAGE 5 OF 11
6. Notice there is a has been reopened, but there is no has been created. This means we ll need to create our own custom label. 7. Click New Custom Label. 8. Provide a Short Description, a label name, and it s value. In our example, we called the Short Description has been created, the name is HasBeenCreatedLabel, and finally the value is has been created. 9. Click Save. 10. Next click New in the Translations section. Select the language you want to translate to. In our example, we ll select Spanish and then provide the Translation Text se ha creado. PAGE 6 OF 11
11. Click Save. 12. Return to your Visualforce template. We ll now replace the second half of the sentence that is part of the email subject. This time, we ll replace has been created with {!$Label.HasBeenCreatedLabel}. The subject designation in the Visualforce Template should now look like this: subject="{!$label.bmcservicedesk ServiceRequestLabel} #(Ref:IN:{!relatedto.Name}) {!$Label.HasBeenCreatedLabel}" 13. Click Save. 14. Now we can test. Since we re working with Service Request Created, the assumption is you have a Service Request already created that you can test. In Workflow Rules, we have a Workflow called Notify the client when a service request is created. You can either modify the existing workflow or clone it. The key is to update the Workflow action so it calls your new Visualforce Email Template. Be sure and activate the flow. PAGE 7 OF 11
Testing Since English is the primary language of BMC Remedyforce, we suspect that your Salesforce System Administrator language is set to English. So English will be our first test. 1. Navigate to Remedyforce Console, set yourself as the Client and then select a Request Definition. Upon saving the record, you should see no notable difference in the email communication that is sent to you. Now let s change the language. Remember our custom label was translated to Spanish so we ll switch our user to Spanish. 2. In Salesforce navigate to Setup Manage Users Users and edit your user. 3. Scroll down to Locale Settings and change Language from English to Español. 4. Click Save. 5. Navigate to the tab now called Consola de Remedyforce. 6. Click Nuevo. 7. Again, enter yourself as the Client and select a Definisión de petición to test with. PAGE 8 OF 11
8. Once you successfully save the Service Request (click Guardar), let s have a look at the resulting email. Notice our email subject has been successfully translated into Spanish! Had we translated our custom label to German, and our user is set to German then the Subject line would be in German. Please also note that this does not affect data that is held within the Salesforce database. The data will be displayed in the language it was entered. Lastly you may find that you need to enable Translation Workbench in order to carry out proper translations. Enabling Translation Workbench 1. In Salesforce navigate to Setup Translation Workbench Translation Settings. 2. If the language you need to translate in to is listed click edit next to the Language. For example, click Edit next to German. 3. Click the Active checkbox and select the user authorized to do any German translations. Click Save. You can also do a lot more with Translation Workbench that is beyond the scope of this document. However this should give you enough information should you have a need to translate Visualforce Email Communication Templates. PAGE 9 OF 11
Business runs on IT. IT runs on BMC Software. Business runs better when IT runs at its best. Tens of thousands of IT organizations around the world from small and mid-market businesses to the Global 100 rely on BMC Software (NASDAQ: BMC) to manage their business services and applications across distributed, mainframe, virtual and cloud environments. BMC helps customers cut costs, reduce risk and achieve business objectives with the broadest choice of IT management solutions, including industry-leading Business Service Management and Cloud Management offerings. For the four fiscal quarters ended December 31, 2012, BMC revenue was approximately $2.2 billion. Visit www.bmc.com for more information.