function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Karen DavisonKaren Davison 

Visualforce email not delivering

Hi

I've created a Visualforce email template in a sandbox, but when testing via the "Send Test and Verify Merge Fields" I don't receive the email despite checking the "Send email preview to:" and entering my email address. 

The merge fields work correctly in the preview pane.
 
<messaging:emailTemplate recipientType="User"
    relatedToType="Insight_Brief__c"
    subject="Test Template"
    replyTo="karen.davison@precise.co.uk" >
    
<messaging:htmlEmailBody >        
    <html>
        <body>
         <STYLE type="text/css">
               TH {font-size: 12px; font-face: arial; background: #000000; border-width: 1;  text-align: center; color: #ffffff } 
               TD  {font-size: 12px; font-face: arial } 
               TABLE {border: solid #000000; border-width: 1; width: 600; border-collapse: collapse;}
               TR {border: solid #000000; border-width: 1}
               ul {list-style-type: square; color:#FFD700;}
               ul li span { color: black; }
         </STYLE>
                  <font face="arial" size="2">
        <p>Dear {!recipient.name},</p>
        <p>Below is a list of criteria related to the Insight Brief:<b> {!relatedTo.name}</b>.</p>  
   
        <p/>                  
       <table border="0" >
                 <tr > 
                     <th>Criteria</th><th>Options</th><th>Note</th>
                  </tr>
    <apex:repeat var="cx" value="{!relatedTo.Criteria__r}">
       <tr>
           <td><apex:outputText value="{!cx.Name}" escape="false"/></td>
           <td><apex:outputText value="{!cx.Options__c}" escape="false"/></td>
           <td><apex:outputText value="{!cx.Note__c}" escape="false"/></td>
       </tr>
    </apex:repeat>                 
       </table>
       <p />
 </font>
       
        </body>
    </html>
</messaging:htmlEmailBody> 
    
<messaging:plainTextEmailBody >
Dear Karen,
 
Below is a list of criteria related to the Insight Brief: {!relatedTo.name}

Job: {!relatedTo.Job__c}


[ Criteria ] - [ Options ] - [ Note ]
-------------------------------------------------------------------------

<apex:repeat var="cx" value="{!relatedTo.Criteria__r}">
[ {!cx.Name} ] - [ {!cx.Options__c} ] - [ {!cx.Note__c} ]
</apex:repeat>

</messaging:plainTextEmailBody>       
        
</messaging:emailTemplate>

Am I missing something obvious?

Thanks
Best Answer chosen by Karen Davison
JeffreyStevensJeffreyStevens
Sandbox?  Have you turned on email deliverability?  When Sandbox's are created/refreshed - the email delierability is automatically turned off.  Setup-Email Administration-Deliverability 
 

All Answers

JeffreyStevensJeffreyStevens
Sandbox?  Have you turned on email deliverability?  When Sandbox's are created/refreshed - the email delierability is automatically turned off.  Setup-Email Administration-Deliverability 
 
This was selected as the best answer
Karen DavisonKaren Davison
Thank you!  I was hoping it would be something ridiculously simple.

Much appreciated.