Subscription ignores UserSecurityRequest of Practi...
# support
t
According to the documentation, this chat and comments on github, I've implemented the sending of personalized emails in medplum: I've added both a subscription and a bot to a project where I have super admin permissions. A few days ago, we updated our self-hosted Medplum system to version 3.1.0, and I’ve started using UserSecurityRequest instead of PasswordChangeRequest. In a different project, where I don't have super admin access, I've successfully added a bot to send custom emails to patients, and that’s working fine. However, I'm struggling to get the subscription feature to work for practitioners—it doesn’t seem to trigger at all. Any insights on what might be going wrong? Thanks!
r
Hi @tinho_14 - in which project is the subscription to
Practitioner
being created - the super admin project or the other project?
t
Hi @rahul1 . The
UserSecurityRequest
subscription was set up in the super admin project to make it "server scoped." This way, it triggers the email-sending bot whenever a new practitioner is invited.
r
HI @tinho_14 , right now
Subscriptions
only fire for resources created in the same project as the
Subscription
resource itself
. That means it will only fire for resources created in the SuperAdmin project. If the
Practitioner
resources are created in other projects, they won't trigger the the Subscription, even if the SuperAdmin project has access to the
Practitioner
t
Thanks for your answer. @rahul1. Is there a way to achieve the behavior I expect?
r
@tinho_14 unfortunately, I think the answer currently is that there is not a way do have a super admin subscription that does what you want
t
don't worry, thanks!
d
so @rahul1 is it not possible to send custom emails to newly invited practitioners? I'm having the same issue with getting a subscription to fire
r
Hi @Deleted User you can set up a subscriptions to send custom emails. The constraint is just that the
Subscription
resource needs to live in the same project as your
UserSecurityRequest
resources
p
recycling this post to ask you @rahul1 We run hosted Medplum. Is it just not possible to send custom emails to Practitioners that I've invited through the Invite via API endpoint? I'm running into this very issue – custom emails work with Patients, but for Practitioners I can only make it work with the default Medplum email (and I don't want that). Been trying to force that behavior to happen by manually creating UserSecurityRequests for those Practitioner User ids I get in the
invite
response but don't see inside my Project, but (as expected) I get Forbiddens. Relatedly, is there a way to NOT have Practitioners be server-scoped, and instead be project-scoped?
150 Views