Quantcast
Viewing latest article 2
Browse Latest Browse All 3

Auto response email not triggered when case created from public site

Hi I am building custom web to case functionality,

Here case getting created from Lighting component which is hosted in a force.com site.

As soon as the case submitted from the site, case is created in salesforce.

Here is the code

Case c = new Case ();
c.SuppliedEmail = 'wagarop@imailto.net';
c.ContactId ='0030v00000Mn1AhAAJ';
c.Origin = 'US/CAN';
c.RecordTypeId ='012o0000000ql6MAAQ';
c.Subject = 'Test';
c.Description = 'Some description';


Database.DMLOptions dlo = new Database.DMLOptions();
dlo.EmailHeader.triggerAutoResponseEmail = true;

Database.insert(c,dlo);

When I execute this code in Internal User context the case created in salesforce and Auto response rule files and Acknowledgement email has been sent to the Contact's Email

The problem: When I execute the same code with Site User Context in the sense that same code is being called from lightning component which is hosted in force.com site, case is created in salesforce, but it will not fire the AutoResponse rule.

Below are things I verified in the org,

  1. Permission for accessing the object
  2. Org wide email address is set to all profiles
  3. Give the Send Email permission to site guest user profile.
  4. Used Email template is placed in public folder.

Apart from is there any thing I have to setup ?

I also been to this https://help.salesforce.com/articleView?id=creating_auto-response_rules.htm&type=5 documentation

Can somebody tell me is there any alternative to trigger auto response when case created from Site Guest User?

Thank you,


Viewing latest article 2
Browse Latest Browse All 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>