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
JeffreyStevensJeffreyStevens 

Workflow visualforce email template not sending

I have a simple workflow that is checking for one checkbox field, if the field is checked, the workflow fires.  There is only one action in the workflow, an email alert (it is a visualforce email template).  I have verified that the workflow is firing (by putting a field update to "un-check" the checkbox that fired the workflow).  However the email is never sent.  I even have my email address as one of the "additonal 5" emails - that email is never sent either.

What sort of things should I be checking to try to troubleshoot this?
 
James LoghryJames Loghry
if you're in a recently refreshed sandbox environment, it's likely the Email Deliverability settings are off.  You can check this by going to Setup->Email Administration->Deliverability settings.

Otherwise, I would also check the Email Logs (Setup->Monitoring->Email Log Files) and make sure the email wasn't sent to the recipient's junk folder.
JeffreyStevensJeffreyStevens
James - thanks fore the response.

It's in production - and I've tried the Email Log file - and it's not even showing up in there.

Here is an image of the rule and email action - maybe it's just something simple that missing?
Workflow rule and email action
 
James LoghryJames Loghry
If nothing is showing in the email log, it's possible an exception is getting thrown prior to the email being sent.  I would create a debug log for your user (whomever is creating the case or updating the send welcome email checkbox) and see if you find anything in the debug logs when you create the case.  Additionally, check the user's profile to make sure they have access to the VF page, apex class, case record, and sobject fields.
AdamDawAdamDaw
Are you leveraging any VF components in your template? If they are erroring out then the email won't send.
JeffreyStevensJeffreyStevens
Okay - good thinking.  The test (send test and verify merge fields) sends it just fine.

I did run a debug on it.  Looks like it's running it in the debug.  But I did notice that I've got a validation rule, AND an Excalation rule on it.  I might disable those rules and see if they are somehow interfering with the email alert workflow rule.  (see image)
Debug log from Case Record update and workflow rule