Skip to main content

Posts

Showing posts with the label sendmail method

Sending Custom Object Information in a Mail

Sometimes we try to send some custom object information in mail. For sending mail Sales-force has  provided 4 types of email template. We can design the template as per our requirement. We can  use simple text template and use merge field to send custom object information. But that template  will work perfectly only If we use in the workflow.  If we send mail from apex code then that merge field value will not be displayed, except we can  display Lead ,Contact and User object information. For example  Dear {!Contact.Name} -- It will display Sub-- {!CustomObject.name}-- It will not display. This functionality is not yet activated by Sales-force, Here is an idea regarding same. https://success.salesforce.com/ideaView?id=08730000000BpYU Why not CustomObject information ? If we use the template in apex code (By using Messaging.SingleEmailmessage method) for sending mail then  setTargetObjectId(ID) method is require...