So I have the following class:
public static void sendmail(String documenttitle)
{
List<Id> contactids = new List<Id>();
List<user> con = new List<User>();
con = [select Id from User where name IN ('User A', 'User B', 'User C', 'User D')];
for(User u : con)
{
contactids.add(u.Id);
}
ContentDocument cont = new ContentDocument();
if(documenttitle.contains('Media'))
{
Messaging.MassEmailMessage mail = new Messaging.MassEmailMessage();
mail.setTargetObjectIds(contactids);
mail.setTemplateId('00AA0000001AaaA');
mail.saveAsActivity = false;
Messaging.sendEmail(new Messaging.MassEmailMessage[] { mail });
}
}
Which sends out an email to four recipients (Users A-D) when apiece of content with the word "Media" in the title is uploaded.
Now, Is there a way to include things such as:
ContentVersion.Title();
ContentVersion.Description();
ContentVersion.ContentUrl();
ContentVersion.OWnerID();
etc...
into the body of the email through apex? I can't seem to find a way to access that info directly through the email template...