Customizing Setup Password Emails in FusionAuth: Handling Invitation Personalization
-
We are implementing a user invitation flow where the initiator uses the Create a User API and sets { sendSetPasswordEmail: true } to have FusionAuth send an email and handle the next steps.
We’d like to personalize the email by adding information such as "You were invited by ABC." However, we couldn’t find a field in the API request to include custom data for use in the email template. This functionality exists in the Send an Email API, where the requestData field allows custom values to be used in the email template.
Are we missing something, or does sendSetPasswordEmail have this limitation?
-
The sendSetPasswordEmail functionality currently has a limitation in that it doesn’t allow you to pass custom data for use in the email template through the API. However, you can still achieve personalization by configuring the email template directly in the FusionAuth Admin UI.
Steps to Personalize the Setup Password Email:
- Edit the Email Template:
- Navigate to Customizations > Email Templates > Setup Password in the Admin UI.
- You can either edit the existing default template or duplicate it to create a new one. Use variables like ${user.firstName!'Unknown User'} or any other user data fields to customize the message.
- Assign the Template to Your Application:
- Go to Applications in FusionAuth.
- Edit your application and assign the appropriate template to the Setup Password field.
- Consider Custom Message Content:
- Include static or semi-dynamic content like "You were invited by ABC" in the email template. If you have multiple initiators, you might need to create separate templates for each scenario.
Documentation for Reference:
While the API does not allow for passing custom fields directly for sendSetPasswordEmail, configuring the templates in the Admin UI should allow you to achieve the desired level of personalization.
- Edit the Email Template:
-