Im receiving
Invalid type: Schema.EmailMessageRelation
and
Invalid type: EmailMessageRelation
compiler error while saving the code.
public class twilioSmsTriggerHandler {
public twilioSmsTriggerHandler() {
}
list<Id> emailIdList = new list<Id>();
public void newEmails(List<EmailMessage> emails) {
for(EmailMessage emailId : emails) {
emailIdList.add(emailId.Id);
}
for(EmailMessageRelation emailmsgId : [SELECT EmailMessageId,
RelationAddress,
RelationId,
RelationObjectType,
RelationType
FROM EmailMessageRelation
WHERE EmailMessageId =: emailIdList]) {
system.debug(emailmsgId);
}
}
}