How to add line break in richtextarea field

I have a requirement to implement a user email signature in visualforce email template,and i have tried this code {!$User.Email_Signature_Rich__c} it’s appering without line breaks in signature.How to add line break in rich text area field.
enter image description here

Email_Signature_Rich__c is Richtextarea field.

E.g. it shows

Test, Queensland, AUS

i want to show like this


<messaging:emailTemplate subject=" Query Notification – DC: {!relatedTo.Distribution_Centre__r.DC_Number__c} - Vendor - {!relatedto.Vendor_Number__r.Vendor_Number__c} {!relatedto.Vendor_Number__r.Name} " recipientType="User" relatedToType="Case">

<messaging:htmlEmailBody >
        <STYLE type="text/css">
          TH {font-size: 11px; font-face: arial;background: #CCCCCC;
               border-width: 0;  text-align: center } 
          TD  {font-size: 11px; font-face: verdana } 
          TABLE {border: solid #CCCCCC; border-width: 0}
          TR {border: solid #CCCCCC; border-width: 5}
        <font face="arial" size="2">

          <p>Hi {!},</p>
          <p>The below DC Receiving Query has been received and requires action:</p>

<table colunm = "6" border = "5">
            <tr > 

               <th>PO Number(s)</th>
               <th> Buyer Name</th>
               <th> Event Number </th>
               <th> Container Number </th>
               <th> Number Pallets / Cartons </th>
               <th> PO Line Item </th>
               <th> Keycode </th>
               <th> Booking Date / Time</th>

            <apex:repeat var="cx" value="{!relatedTo.Big_W_Case_PO__r}">
              <!--<td><c:Email_DC_Receiving thiscaseId="{!}" /> </td>--> 
                <td><c:Email_DC_Receiving_PoLineItem thiscaseId="{!}" /> </td>
                  <td><c:Email_DC_Receiving_Keycode thiscaseId="{!}" /> </td>  

                <td><c:BIG_W_Locale_FormatDateTime date_Timevalue="{!cx.PO__r.Booking_Date_Time__c}"/></td>



              <b> Kind Regards,</b><br/>
            <!--  {!$User.Email_Signature_Rich__c}-->
           <apex:outputField value="{!recipient.Email_Signature_Rich__c}"/>     



The solution would to use OutputField so that formatting stays rather than simple merge field

<messaging:emailTemplate subject="helo" recipientType="User" relatedToType="Case">
<messaging:htmlEmailBody >
  <apex:outputField value="{!recipient.Email_Signature_Rich__c}"/>

Source : Link , Question Author : user7292 , Answer Author : Mohith Shrivastava

Leave a Comment