Platform really helps in setting up custom notifications within salesforce or for external system. While utilising the platform events in salesforce, you need to consider below things:
- Record Owner considerations
Whenever you create record from after insert using triggers, then ownerid of those records will be Automated Process by default. If you have set current user as record owner, then specify ownerid of created records as createdbyId of event.
Account acc= new Account(name='test account through Demo platform event',OwnerId = event.createdById);
- Platform Event Trigger do not provide Email Support
In Apex, use the SingleEmailMessage.setOrgWideEmailAddressId method to set the org-wide email.
Hope this will help!!