====== Letter Template & Merge Fields ====== This section is for identifying and understanding how to use Letter Generation and specifically, Letter Template. Letter Template is the object used to create templates for use as receipt letters, award letters or other communication connected to a record. It works in conjunction with Letter Template Merge Fields and Letter Output. ===== Content ===== * [[donor360:using_donor_360:130letter_template#Custom Fields|Custom Fields]] * [[donor360:using_donor_360:130letter_template#Field Set|Field Set]] * [[donor360:using_donor_360:130letter_template#Permission Set|Permission Set]] * [[donor360:using_donor_360:130letter_template#Apex|Apex]] * [[donor360:using_donor_360:130letter_template#Action|Action]] * [[donor360:using_donor_360:130letter_template#Flow|Flow]] * [[donor360:using_donor_360:130letter_template#Letter Template record|Letter Template record]] * [[donor360:using_donor_360:130letter_template#Letter Template Merge Field records|Letter Template Merge Field records]] * [[donor360:using_donor_360:130letter_template#Merge Fields to Template Body|Merge Fieds to Template Body]] * [[donor360:using_donor_360:130letter_template#Tables within Letter Template record|Tables within Letter Template record]] ==== Custom Fields ==== Some of these fields are Picklist and need to have values assigned and others are populated by users. Work with your teams to determine which fields you plan to use. Make sure these are included on the Fund Page Layout and Lightning Page. **Letter Template Object:** * Display Letter Review and Edit Screens? * Source Object * Template Type * Email Subject * Template Body **Letter Template Merge Fields Object:** * Letter Template * Letter Template Source Object ==== Field Set ==== An example field set is included with several objects where tables can be used in a Letter Template. Add and rearrange fields as needed. * Payment: Letter Template Merge Fields * GAU Allocation: Letter Template Merge Fields * GAU Expenditure: Letter Template Merge Fields ==== Permission Set ==== * Assign **Letter Administrator** permission set to the system admin and any other user/staff member who will create letters. Users must have at least Read rights to generate the letter merges (Letter Output) ==== Apex ==== * TDTM_LetterTemplate * LetterTemplate_TDTM ==== Action ==== * **Clone with Related** button will clone the Letter Template record along with the Letter Template Merge Field records and then allow the user to edit as needed. ==== Flow ==== * Letter_Template_Generate_Template * Letter_Template_Clone_with_Merge_Fields * Example_Determine_Letter_Template_for_Funding_Request_to_be_used_and_call_Genera * use this template flow to get the assigned Letter Template on the Funding Request object. This flow will then call the Letter Template - Generate Template flow which generates the Letter Output. * Create a button on the Funding Request Object to open this screenflow * Example_Determine_Letter_Template_to_be_used_and_call_Generate_Letter_Template_s * use this template flow to get the assigned Letter Template on the Opportunity object. This flow will then call the Letter Template - Generate Template flow which generates the Letter Output. * Create a button on the Opportunity Object to open this screenflow ==== Letter Template record ==== For the best results, if copying and pasting text from a Word document, paste it to Notepad first to remove formatting, then copy again from Notepad and paste into the Template Body field. From the **Letter Template** object, select **New** button then * Assign a **Name** * Select **Source Object** * Select **Template Type** * Template Body should be populated with the desired letter text and indicate where merge fields are to be located. * **Save** {{ :donor360:using_donor_360:lettertemplatenew.png?600 |}} ==== Letter Template Merge Field records ==== * Create merge fields by clicking the related list drop-down arrow and select **New** {{ :donor360:using_donor_360:lettertemplatemergefieldnewbutton.png?600 |}} * In the field with the same object name as selected in the Letter Template record header, Select the object where the field is to be retrieved from * In the **Merge Field API Name** field, paste the API name of the field to merge. {{ :donor360:using_donor_360:lettertemplatemergefieldnew.png?600 |}} * **Save** {{ :donor360:using_donor_360:lettertemplatemergefieldsaved.png?600 |}} * Repeat steps for every merge field ==== Merge fields to Template Body ==== * Copy the values in the **Merge Value to Paste** field from every Letter Template Merge Field record and paste into the appropriate location of the Template Body * **Save** A completed Letter Template will look something like the screenshot below {{ :donor360:using_donor_360:lettertemplatecomplete.png?600 |}} ==== Tables within Letter Template record ==== Letter Generation allows for creating tables with record data merged into a letter template. * To Create a table in the Template Body, Select **Table** for the **Multi-Table Output Type** field, then **choose the object** to use as the table in either the Merge Object-Disbursement Multi-Table or Merge Object-Opportunity Multi-Table * Set the Font size for the Table * Additional setup is required as noted in the **Multi-Table Field Required Setup Needed** field. Once completed, move on to the next step * Use the **Merge Value to Paste field** as the merge field pasted to the Template Body where the table should appear The screenshot below shows the required setup for merging a table into a letter template {{ :donor360:using_donor_360:lettertemplatetable.png?600 |}} {{ :donor360:using_donor_360:lettertemplatetablefieldset.png?600 |}}