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
Michael PuglieseMichael Pugliese 

VF/Apex Case Form - DML Options not triggering Auto-Response Rules

Hello! 

We have an existing web-to-case visualforce form hosted on a Force.com site. Part of the apex class includes setting the DML options, specifically "EmailHeader.triggerAutoResponseEmail"
// Specify DML options to ensure the assignment rules are executed
        Database.DMLOptions dmlOpts = new Database.DMLOptions();
        dmlOpts.AssignmentRuleHeader.useDefaultRule = true;
        dmlOpts.EmailHeader.triggerAutoResponseEmail = true;
        WebCase.setOptions(dmlOpts);

        INSERT WebCase;

Even though we are setting auto response as true, we have been unable to trigger the case auto-respose emails using this form. 

This is in a sandbox environement, email deliverability = all (auto-response rules work with the SFDC standard HTML form), and nothing sends for existing contacts or when only web-email is provided. I know I can set up a trigger/workflow for this specifically, but would prefer not to make an exception for a single form. 

Any tips or assistance would be appreciated!