Facing 'System.EmailTemplateRenderException: Too many SOQL queries: 101' exception while using visual-force email template with custom controllers.
Api - Messaging.SingleEmailMessage templateInstance = Messaging.renderStoredEmailTemplate(email template Id, user Id, record Id);
Not able to figure out how SOQL is reached. Any idea on same? Following is Debug log information :
13:28:43.439 (1439878776)|LIMIT_USAGE_FOR_NS|(default)| Number of SOQL queries: 11 out of 100 Number of query rows: 788 out of 50000 Number of SOSL queries: 0 out of 20 Number of DML statements: 0 out of 150 Number of DML rows: 0 out of 10000 Maximum CPU time: 0 out of 113000 Maximum heap size: 0 out of 6000000 Number of callouts: 0 out of 100 Number of Email Invocations: 0 out of 10 Number of future calls: 0 out of 50 Number of queueable jobs added to the queue: 0 out of 50 Number of Mobile Apex push calls: 0 out of 10