Sending Different Welcome Emails By Role

Hello Auth0 Community,

We have several distinct roles that give access to different applications and services. Is there a method to send different welcome emails based on the Role or Roles associated with a user? For example; Bob has role DO Stuff and Tina has role Review Stuff, Bob should get Welcome to Doing Stuff email, and Tina should get the Welcome to Reviewing Stuff email with different content than the email bob received.

Hi @dkaminsky,

The Welcome Email should have access to common variables, including user.app_metadata. If you create the user with the role stored in the user’s app_metadata, then you can conditionally render content using Liquid Syntax:

{% if user.user_metadata.role == 'do-stuff' %} [email body for "do stuff" role] {% elsif user.user_metadata.role == 'review-stuff' %} [email body for "review stuff" role] {% endif %}

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.