Need help with this.
We have several support email addresses. A case is created when a customer sends us an email to one of those email addresses. We are using only one case record type. When a case is created from Email-to-Case, we want to set a product family value based on what email address it is.
If the email address is supportApple@company.com, set the product family value to "Apple."
If the email address is supportOrange@company.com, set theproduct family value to "Orange."
How do I do this with a Case Trigger or Apex?
You can do this with clicks instead of code. You can do a workflow eule based on the email message object on create where the "To Address" = your email2case address.
Then have your action be a field update for the product family field.
You can also do a process, again based on the Email Messaged object on create to fire when the created date for the case = NOW()