I have a very simple error handling case. I need to send an email to the running user, who almost certainly does not have an associated Contact record. I also need to specify the error record in question so I can send a link to it. Easy, right?
However, according to the documentation for setWhatId:
If you specify a contact for the targetObjectId field, you can specify a whatId as well
So it doesn't work with a User Id. Why can't I send an email via template to a specific user about a specific record? This seems like a huge shortcoming in Apex. Creating a Contact record for each User is not an acceptable workaround.