
tHtmlBody(‘Dear ‘+c.Executive_Name_r.Name+ ‘,’+’Your current tentative blocks are as under with the respective block release dates.’+’ Name of Resort First Name Company /Travel Agent Block Release Date Check In Check Out Rooms Booking Status Source Market Segment Executive Name ‘ +”+”+ c.Resort_Master_r.Name +”+”+ c.Name_of_the_Guest_c +”+”+ c.Company_Name_c +”+”+ c.Block_Release_Date_c+”+”+ c.Check_In_c +”+”+ c.Check_Out_c +”+”+ c.Total_Number_of_Rooms_Booked_c +”+”+ c.Booking_Status_c+”+”+ c.Source_c +”+”+ c.Market_Segment_c +”+”+ c.Executive_Name_r.Name+”+’ ‘+’Please let us know of the payment and contract details in order to regularize & confirm the same on the system. Sending an email with Apex is easy because you always follow the same template: // Send a business proposal to each new Contact trigger Proposal on Contact ( before insert) )

It’s sometimes helpful to send emails only when a field changes to a certain value.If you can create the email alert using workflows instead of code, always do it with workflows!.There are limits to the number of emails you can send per day.Here are a few things to keep in mind before sending emails with Apex: Just don’t be tempted to become an email spammer, trust me, I used to work in that industry!

It’s surprisingly easy to send emails out using Apex! Preface: this post is part of the Advanced Apex Concepts series.
