What I mean by the title is that email-to-case gives an email message in the case, to which you can easily reply to. Web-to-case just seems to fill out a bunch of fields per your choosing, but I was wondering if I could somehow spoof an email message (since we collect email addresses, subject, and description anyway). Is something like this possible?
1 Answer
EmailToCase creates a special SObject called EmailMessage
, documented here.
- The SObject can be created by APEX so you could use an after Insert trigger on Case to populate
- If you expect to send replies to the customer from here and have the customer then reply back via email, you'll need to simulate how SFDC creates threadIds and put into the
subject
. This will allow emailToCase to associate the incoming reply from the customer back to the web-created Case. See SFDC Success post here. - Most of the fields in
EmailMessage
can be created - howeverhasAttachment
can not. It is possible that if your trigger also insertsAttachment
objects as children toEmailMessage
, this field will populate automatically. I have not tried this. - You would need to simulate the field
textBody
from other fields you collect on the web form