I'm looking for the most straightforward way to trigger a custom Ensemble message when a patient logs into the Personal Community patient portal. The use case is that when the patient logs in, we want to query an external email database for any new messages the patient has and import them. Does anybody know if there's any built-in functionality I can use, or if not, what the best trigger point would be?
Adding an OnLogin() callback method (as suggested by the previous answer) will only work for the current
user's messages. If the user is a proxy for some other principal, the user won't see the
principal's new messages.
The suggestion is to instead configure the SDAOperation setting on the SDA service
(HSPortal_SDAService) to send requests to an Ensemble component that triggers the request to
retrieve messages and forwards the message to the existing SDA operation (HSPortal_SDAOperation).
This has a few benefits:
- The account interface doesn't get touched
- The user would get notified of messages from all principals, not just the current user
- The work would occur in the background instead of blocking the login process