6 Replies to “Visualforce Email Template with Records”

  1. Please find my code which is not triggering email.

    Apex class:
    public class acctTemplt
    {
    public Id Traveling_Dependents{get;set;}
    public List getopptys()
    {
    List oppty;
    oppty = [SELECT Dependent__c FROM Traveling_Dependents__c WHERE Travel_Request__c =: Traveling_Dependents];
    return oppty;
    }
    }

    VF Controller:

    Dependent Name

    {!o.Dependent__c}

    Email Template:

    Hi,
    Below is the list of Travelling Dependents for your Travel Request {!relatedTo.Name}.

    Regards,
    Kaativik

    Like

  2. Hi sfdcFanBoy, I was working on same scenario but different objects.
    Travel_Request__c
    Travel_Dependents__c
    These two objects are connected with masterdetail relationship with field name “Travel_Request__c”, when I replace Accountid with Travel_Request__c in
    global String accountId{get;set;}
    then I am getting error, can you please help me out for this

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s