fusionauth

Set Password email by application


I have 2 applications on the same Tenant.

I can configure an email template for the "Set Password" workflow on:

When I register a new user using the UI, as far as I understood it will only be able to send the email configured on the tenant level since it won't know anything about which application the user can see until the next step when I add the registrations.

If I create a user and add registration to it right away (on the same step) then this takes the Template configured on the application level.

My questions are:

  1. Can we do something like this through the UI interface too? My applications have a different user base (some have accounts on both) and it would be nice to be able to send them one email or the other.
  2. Or is this only possible through the API?
  3. If I register a user with both applications (through the API) which email do they get?

Thanks for the help!


Solution

  • Can we do something like this through the UI interface too?

    This is not currently possible. Creating the User, and creating a User Registration are two separate steps. As you correctly stated, when creating the user in the UI, there is no context yet for an application. For this reason, the user will receive the template configured at the tenant level.

    Or is this only possible through the API?

    Correct. You must use the Create "User + Registration" API to do this in one step to use the application template for setup password.

    If I register a user with both applications (through the API) which email do they get?

    When using the API to Create "User + Registration" you can only register for one application at a time. The email is only sent during the User Create step, so if you register for a second application, the user will already exist and thus will not receive a second email.