Email invitations: application context in post-change-password event?

I want to use Send Email Invitations for Application Signup for a use-case in which there can be multiple pending invitations for the same email address: each invitation is associated with some state in our application that’s used to configure the user if that invitation is accepted.

We’d send an email containing a “change password” ticket url for each invitation. (/tickets/post-password-change API doesn’t suggest that you can only have 1 valid ticket per user.)

When one is actioned we’d use Post Change Password Trigger to notify our application that an invitation has been accepted.

I can’t however see any way to pass per-invitation state through this flow, eg by exposing the unique ticket url in the trigger event object.

Have I missed a way of achieving this?

(If this isn’t possible then we’ll have to simplify our invitation UX to prevent the creation of multiple invitations.)

(Apologies if this is tagged incorrectly, the UI didn’t allow me to select tags like “password-change” I can see in other community posts. I’ll try to fix once I’ve created the topic.)

– Richard

Hi @richard.barnett

Thank you for reaching out to us!

After doing some testing, I can confirm that only one valid change password ticket can exist for a user at any one time, as generating a new one will invalidate the previous one.

While we currently do not have a built in way of supporting your use-case, I believe that as a workaround, you could extract the ticket id after it was created, before sending the email, and setting that value on the user’s app_metadata. Once completed, you application could use this value ( potentially as an identifier ) and apply the logic based on this.

Hope this helped!
Gerald

Thanks for the reply Gerald.

If you only support 1 ticket per user then my use-case has to be abandoned.

Your work-around isn’t necessary: when a password change ticket is used the application would use the state associated with the most recent ticket (invitation), because other than for rare race conditions this is the only one that could have been used.

Is it possible to customise the UI displayed for an invalid ticket?

– Richard