Linked Questions

24 votes
6 answers
39k views

Passing custom string into a Salesforce email template.

I've stumbled upon a problem at the final stage of a new feature I was building (as always) I need to pass in a custom string into a salesforce template, however there doesnt seem to be a way of ...
c14kaa's user avatar
  • 1,116
2 votes
2 answers
11k views

Sending VF email template using SingleEmailMessaging- Getting blank Email body

I have a VF email template as below which has relatedTOType as Job_Application__c and recipientType as User. I am using some merge field in this template: <messaging:emailTemplate subject="TEST" ...
SfdcBat's user avatar
  • 4,839
0 votes
2 answers
13k views

How to get Email Template executed body

I am working on sending email by using 3rd party application like Amazon SES When i query for perticular email template i am getting body whaever the email templated had like Email Template body ...
Sunny's user avatar
  • 683
4 votes
1 answer
6k views

Preview email content of email templates before sending

I am developing a feature to send a email from a Custom Visualforce page. For this I am using the Messaging.SingleEmailMessage class. I need to give users, the option to select email templates from ...
sagar's user avatar
  • 113
3 votes
2 answers
2k views

Render a Salesforce Email Template in a Visualforce Page

I need to be able to load and render an email template in a visualforce page. What are my options here? I understand that loading it is as simple as querying the EmailTemplate table. Now how do I ...
Jan J's user avatar
  • 2,634
1 vote
2 answers
3k views

How to write unit tests for emails being sent via Apex?

If I send an email via Apex Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); mail.setTargetObjectId(someContactId); mail.setTemplateId(someTemplateId); mail.setSaveAsActivity(...
Willem Mulder's user avatar
2 votes
0 answers
4k views

Dynamic Email Template Body

I have a requirement where I need to send the email template and also allow the use to change it and then send the content. I am able to send email and attach a VF template dynamically. But I am not ...
user2703132's user avatar
3 votes
1 answer
2k views

How to render a VisualForce email template to string

Is there a way, using Apex, to trigger the rendering of a VisualForce email template and capture the result as a string? This would be used to set the HTML Body of an email to be sent using an ...
RobD's user avatar
  • 414
1 vote
3 answers
2k views

Using Batch APEX to generate template body dynamically with merge field values

I am using Amazon SES to send mails to the all opportunities using batch apex with the body of email template. I'm using the solution proposed in an answer to Using APEX to assemble HTML Letterhead ...
Sunny's user avatar
  • 683
4 votes
1 answer
2k views

Rendering an Email Template with merged values

A while back I accidentally discovered this GREAT feature of Salesforce where I could display a merged email template via a URL. It was a great feature to show sample emails in my help documentation....
JodieM's user avatar
  • 1,215
2 votes
1 answer
3k views

How to get Visualforce Email template content in apex?

I have a requirement where i have to use Visual force Email template.so, i have created a vf email template.Now i want to get that vf email body in apex controller.i now if i use custom HTML template ...
vishnu's user avatar
  • 53
3 votes
1 answer
2k views

Can I merge an email template in Apex, and also inspect it from code

Can I get the merged email template in Apex without sending it? I'd like to inspect the generated email first. I think I found the answer on https://salesforce.stackexchange.com/a/8745/2330
ipavlic's user avatar
  • 3,766
1 vote
1 answer
2k views

can setTemplateId be used along with SetHtmlBody for the following code?

public EmailMessageWrapper(String fromAddr, Id toAddrId, String sub, Map<String, String> mapSubjectParams, Map<String, String> mapBodyParams) { this(fromAddr, null, toAddrId, null, ...
Surgaya Khundrakpam's user avatar
2 votes
3 answers
1k views

How to avoid to send the mail to owner field

I have used the following code for sending the mail with template. but I don't want to send the mail to owner. List<String> toAddress = new List<String>(); toAddress.add(my email ...
Lemon's user avatar
  • 895
2 votes
2 answers
1k views

Get VisualForce Email Template as Blob

Similar to how we can use apex to get the blob value of a VisualForce page, can we also do this on a VisualForce Email Template? We need to get the rendered template into an attachment record in ...
Joey Chan's user avatar
  • 938

15 30 50 per page