function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
h20riderh20rider 

Problem with Custom Components on an Email Template

I have written a custom component for a Email template.  Everything looks fine except the table doesnt get populated with the date within the component. I do see the table headings. I tried to add debugging using the system.debug but that doesnt appear in the logs

 

here is what I have

Email Tamplate

<c:BD_Email_Template_Invitees EventId="{!relatedTo.Id}"></c:BD_Email_Template_Invitees>

 

Component

<apex:component controller="BD_Email_Template_Invitees_Controller" access="Global">
<apex:attribute name="EventId" description="This is the EventId." type="Id" assignTo="{!thisEventId}"/>
<table border="1">
<tr>
<td><apex:outputText value="Name"/></td>
<td><apex:outputText value="Account"/></td>
<td><apex:outputText value="Title"/></td>
<td><apex:outputText value="Email"/></td>
<td><apex:outputText value="Phone"/></td>
</tr>
<apex:repeat value="{!invitees}" var="xx" id="theRepeat">
<tr>
<td>{!xx.Name}</td>
<td>{!xx.Account}</td>
<td>{!xx.Title}</td>
<td>{!xx.Email}</td>
<td>{!xx.Phone}</td>
</tr>
</apex:repeat>
</table>
</apex:component>

 

Conponent Controller

public with sharing class BD_Email_Template_Invitees_Controller {

public Id thisEventId {get;set;}

public Set<Id> attendeeId = new Set<Id>{};
public List<Invitees> invitees = new List<Invitees>{};

public List<Invitees> GetInvitees()
{
system.debug('#### GetInvitees(): ' + thisEventId);
invitees = new List<Invitees>{};
for (EventAttendee eventAttendee : [Select Id, EventId, AttendeeId From EventAttendee where EventId = :thisEventId])
attendeeId.add(eventAttendee.Id);
try
{
for ( User user : [Select Title, Phone, Name, Email, AccountId From User where Id in :attendeeId])
{
Invitees invitee = new Invitees();
invitee.Title = user.Title;
invitee.Name = user.Name;
invitee.Email = user.Email;
invitee.Phone = user.Phone;

invitees.add( invitee );
}
} catch (Exception ex) {}

try
{
for (Contact contact : [Select Title, Phone, Name, Email, AccountId From Contact where Id in :attendeeId])
{
Invitees invitee = new Invitees();
invitee.Title = contact.Title;
invitee.Name = contact.Name;
invitee.Email = contact.Email;
invitee.Phone = contact.Phone;

invitees.add( invitee );
}
} catch (Exception ex) {}
return invitees;
}

public class Invitees {

public String Name { get; set; }
public String Account { get; set; }
public String Title { get; set; }
public String Email { get; set; }
public String Phone { get; set; }
}
}

 

 

h20riderh20rider

In solved the issue.  My query was wrong.  which brings me to the question why cant you see this in  the logs