• vidya pawar
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi folk,

 

Hopefully you smart guys can help me out here. I have similar problem like you. I am trying to send an email from custom object with the related list. My custom object is 'Sample Tracking'

I created an email button on custom object with the following.

 

location.replace('/email/author/emailauthor.jsp?re​tURL=/{!Sample_Tracking__c.Id}&rtype=003&p2_lkid={​!  Sample_Tracking__c.Recipient_ContactId__c }&template_id=00XJ0000000QD59&p5=')

 

I created an email template with following:

<messaging:emailTemplate subject="Sample Tracking Products and Product Descriptions" recipientType="Contact" relatedToType="Sample_Tracking__c"> <messaging:HtmlEmailBody > <html>     <body>      <STYLE type="text/css">            TH {font-size: 11px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align: center }            TD  {font-size: 11px; font-face: verdana }            TABLE {border: solid #CCCCCC; border-width: 1}            TR {border: solid #CCCCCC; border-width: 1}      </STYLE>          <font face="arial" size="2">

  <p>Dear {!recipient.name},</p>       <p>Below is a list of Products and Product Descriptions cases related to the Sample Request: {!relatedTo.Id}.</p>       <p> {!relatedTo.Recipient_Contact__c}.</p>           <table border="0" >         <tr >             <th>Product</th><th>Product description</th><th>Send Quantity</th><th>Cost</th>          </tr> <apex:repeat var="cx" value="{!relatedTo.Product_Samples__r}">    <tr>        <td><a href="https://na1.salesforce.com/{!cx.id}">View</a> |         <a href="https://na1.salesforce.com/{!cx.id}/e">Edit</a></t​d>        <td>{!cx.name}</td>                 </tr> </apex:repeat>       </table>       <P/> </font>        </body>    </html>

</messaging:htmlEmailBody> </messaging:emailTemplate>

 

The problem I am getting is, when i click the email button the sample tracking is is not passed to the email template. And the email template don't return anything. It loads properly with contact in 'to box' of email and subjects text comes properly but the particular sample tracking page from which I click the email button is not passed to the template. So none of the related lists shows up.

 

Please suggest. I have spend about a week with no solution. Appreciate your time.

 

Thanks

Swayam