Sample Salesforce Print Anything Letter Template

Below are samples of a Salesforce Print Anything letter template content, css_javascript, queries and buttons.

Template Content

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
 
<style type="text/css"> 
/*<![CDATA[*/ 
<!-- 
--> 
/*]]>*/ 
</style> 
</head> 
<body> 
<div class="Body"> 
<div class="TopThird"> 
<!-- Return Address --> 
<!-- REPLACE WITH YOUR RETURN ADDRESS --> 
<div class="ReturnAddress"> 
ACB IT inc<br/> 
1020 Perfect st<br/> 
Townville, NY  20110 
</div> 
<!-- Company Logo --> 
<div class="CompanyLogo"><img src="http://www.postalmethods.com/files/YourLogoHere.png"></div> 
<!-- Right Field Info Table --> 
<div class="InfoTable"> 
<table class="InfoTableTDs" border=1 cellpadding=2 cellspacing=0> 
<tr> 
<td colspan=2><strong>Account Details</h3></strong> 
</tr> 
<tr> 
<td>Account Number</td> 
<td>{Account1.AccountNumber}</td> 
</tr> 
<tr> 
<td>Contract Beginning</td> 
<td>June 3, 2008</td> 
</tr> 
<tr> 
<td>Contract Expiration</td> 
<td>June 2, 2009</td> 
</tr> 
</table> 
</div> 
 
<!-- Recipient Address --> 
<!-- MERGE ACCOUNT ADDRESS --> 
<div class="RecipientAddress"> 
{Account1.Name}<br/> 
{Account1.BillingStreet}<br/> 
{Account1.BillingCity} {Account1.BillingState}  {Account1.BillingPostalCode}
</div> 
 
</div> 
<!-- Content of the letter --> 
<div class="BodyContent"> 
 
<h2>Service and Support Contract #87396</h2> 
 
<h3>Dear {Account1.Name},</h3> 
<p> 
Our records indicate that your Service and Support Contract with us, for your office in {Account1.ShippingCity}, {Account1.BillingState}, has expired. A renewal agreement is enclosed. To ensure uninterrupted service and support, please sign and return it right away. There is no need to enclose payment with your renewal instructions.</p> 
 
<p>Our fast, responsive service and support keeps your critical business computing systems up and running. When there is a problem, we are there in a flash. Speedy repair or replacement minimizes downtime and keeps your business going.</p> 
 
<p>As one of our system users, you get year-round service and support for a discount of 30 percent off what we charge to businesses that do not own or lease one of our systems.</p> 
 
<p>Rising parts and labor costs will soon force us to raise our support and service fees to new customers. Renew now to lock in your current low contract rate for the next 12 months before our prices go up.</p> 
 
Sincerely,<br /> 
{User2.Name} 
 
<p class="PS">P.S. To lock in the discount renewal rate and avoid paying full contract price, act now before your current contract expires. Renewing now also ensures that your service coverage will continue uninterrupted.</p> 
 
 
<div class="PageBreak">&nbsp;</div> 
<h3>Page 2</h3> 
<p>As one of our system users, you get year-round service and support for a discount of 30 percent off what we charge to businesses that do not own or lease one of our systems.</p> 
 
<p>Rising parts and labor costs will soon force us to raise our support and service fees to new customers. Renew now to lock in your current low contract rate for the next 12 months before our prices go up.</p> 
</div> 
</div> 
</body> 
</html>


Template Css_Javascript

setStyleByClass('div','Body','textAlign','left'); 
setStyleByClass('div','Body','whiteSpace','normal'); 
setStyleByClass('div','Body','fontFamily','"Times New Roman", Times, serif'); 
setStyleByClass('div','Body','margin','0px'); 
setStyleByClass('div','Body','padding','0px'); 
setStyleByClass('div','Body','height','11in'); 
setStyleByClass('div','Body','width','8.5in'); 
setStyleByClass('div','Body','marginLeft','0.5in'); 
setStyleByClass('div','Body','marginTop','0.5in'); 
setStyleByClass('div','Body','marginBottom','0.5in'); 
setStyleByClass('div','TopThird','position','relative'); 
setStyleByClass('div','TopThird','height','2.875in'); 
setStyleByClass('div','TopThird','width','7.4in'); 
setStyleByClass('div','ReturnAddress','position','absolute'); 
setStyleByClass('div','ReturnAddress','width','3.5in'); 
setStyleByClass('div','ReturnAddress','height','0.792in'); 
setStyleByClass('div','ReturnAddress','fontSize','9pt'); 
setStyleByClass('div','ReturnAddress','textTransform','uppercase'); 
setStyleByClass('div','RecipientAddress','position','absolute'); 
setStyleByClass('div','RecipientAddress','top','1.542in'); 
setStyleByClass('div','RecipientAddress','width','3.5in'); 
setStyleByClass('div','RecipientAddress','height','0.875in'); 
setStyleByClass('div','RecipientAddress','fontSize','9pt'); 
setStyleByClass('div','RecipientAddress','textTransform','uppercase'); 
setStyleByClass('div','CompanyLogo','position','absolute'); 
setStyleByClass('div','CompanyLogo','left','2in'); 
setStyleByClass('div','CompanyLogo','width','1.45in'); 
setStyleByClass('div','CompanyLogo','height','0.792in'); 
setStyleByClass('div','InfoTable','position','absolute'); 
setStyleByClass('div','InfoTable','left','5.5in'); 
setStyleByClass('div','InfoTable','top','1in'); 
setStyleByClass('div','InfoTable','width','2.8in'); 
setStyleByClass('div','InfoTable','height','2in'); 
setStyleByClass('table','InfoTableTDs','fontSize','11px'); 
setStyleByClass('div','BodyContent','position','relative'); 
setStyleByClass('div','BodyContent','left','0in'); 
setStyleByClass('div','BodyContent','width','7.4in'); 
setStyleByClass('div','BodyContent','fontSize','12pt'); 
setStyleByClass('div','BodyContent','lineHeight','1.5'); 
setStyleByClass('div','BodyContent','whiteSpace','normal'); 
setStyleByClass('div','BodyContent','margin','0'); 
setStyleByClass('div','BodyContent','padding','0'); 
setStyleByClass('div','PageBreak','pageBreakAfter','always'); 
setStyleByClass('div','PageBreak','height','1px'); 
setStyleByClass('div','PageBreak','margin','0'); 
setStyleByClass('div','PageBreak','padding','0'); 
setStyleByClass('p','PS','fontStyle','italic'); 
setStyleByClass('p','PS','fontSize','9pt'); 
setStyleByClass('p','PS','fontWeight','bold');


Query Samples

    • Query Name: Account
    • Sequence: 1
    • Singleton Field List: Id
    • Retrieve Entity: Account
    • Retrieve Field: Parameter.id
    • Query Name: Owner
    • Sequence: 2
    • Singleton Field List: Id
    • Retrieve Entity: User
    • Retrieve Field: Account1.OwnerId


Button Sample

This is how a button positioned in the Account record is set. The button queries the account for data and merges the required fields to the template.

{!URLFOR( 
$SControl.Postal_Methods__PMPrintAnythingDriver, 
Account.Id, 
[ 
packageId="ContractRenewal", 
type="Account", 
id=Account.Id, 
name= Account.Name
]) 
}