Use case: Allow end users to update their business profile (marketing

Author:

Lucy Billington

Created at:

Nov 2022

Updated at:

Dec 2022

Use case overview

Putting users in control of their business profile attributes, such as communication email preferences, helps you to build trust with your customers.

In ForgeRock Identity Cloud, you can configure which business profile attributes customers can see and which ones they can update. For example, users can opt-in or opt-out of communications such as news and updates, special offers, and loyalty program updates. Email addresses of users who have opted in will be automatically synchronized to a target system such as a marketing platform or loyalty program. Email communication preferences can be set and controlled with a synchronization rule to a target system.

If required, you can force a particular communication preference, such as account security alerts, to always be “true” (enabled) so that the user can’t opt out of receiving these alerts.

Steps to achieve this use case

This use case demonstrates how to configure Identity Cloud to enable customer preferences for receiving the following communication emails:

  • news and updates

  • special offers and services

  • loyalty program updates

  • account security alerts

In this use case, the preferences data for each communication type is synced to a managed object that stores a list of email addresses of users who have opted in. Account security alerts are configured so that the user’s email address is always synced to the list, regardless of user preference.

This use case can be achieved in four simple steps:

  1. Update the preferences property in the alpha_user managed object

  2. Create managed objects for email communication subscribers

  3. Create mappings from alpha_user to the target email lists

  4. Enable preferences for end users (in the end user UI)

Update the preferences property in the alpha_user managed object

  1. Sign in to the Identity Cloud admin UI using your admin tenant URL, in the format https://<tenant-name>/am/XUI/?realm=/#/.

  2. Go to Native Consoles > Identity Management > Configure > Managed Objects.

  3. Select the Alpha_user managed object.

  4. In the Properties tab, select the preferences property.

  5. Click Add a Property.

  6. Enter the following details and click Save:

    • Property name: custom_loyalty

    • Label: Loyalty Program

    • Type: Boolean

      https://backstage-community-prod.storage.googleapis.com/original/2X/a/aedf456f19e4c49836542114d6dd8fef4ef062f4

  7. Click the Edit icon and enter a description of “Send me loyalty program updates” and click Save.

    https://backstage-community-prod.storage.googleapis.com/original/2X/c/cafc8215d9267fb8d64781a14a8a41b80c341e52

  8. Click Add a Property.

  9. Enter the following details and click Save:

    • Property name: custom_security

    • Label: Security Alert

    • Type: Boolean

      https://backstage-community-prod.storage.googleapis.com/original/2X/c/c89c5f1bff9c2c16f5c6c6aad63339f9e723a908

  10. Click the Edit icon, enter a description of “Send me account security alerts (default)” and click Save.

    https://backstage-community-prod.storage.googleapis.com/original/2X/5/554578dd60e581b1a78d17d54b41b697a36c941d

  11. In the Details tab, set the Security Alert to true. This will set the security alert preference to “On” by default for all users.

    https://backstage-community-prod.storage.googleapis.com/original/2X/2/2d1f72eaae6b97d2169db8df50babdba850b3f2b

  12. Click Save.

  13. Go to Managed Objects > alpha_user.

  14. In the Scripts tab:

    a. Select onStore.

    https://backstage-community-prod.storage.googleapis.com/original/2X/d/d62f115fb78fd8c6ca2b104f59b02350b579b2c2

    b. Click Add Script.
    c. Add the following JavaScript

    +

    if (typeof object.preferences != "undefined" && object.preferences != null) {
        object.preferences.custom_security = true;
    }

    + d. Click Save.

    + https://backstage-community-prod.storage.googleapis.com/original/2X/2/25adabe3fae5037ce470bac7415bcceed0f0ac42

Create managed objects for email communication subscribers

We’ll create a managed object for the target to store email addresses of subscribers to: email_offers (special offers and services), email_news (news and updates), email_loyalty (loyalty program updates), and email_security (account security alerts).

  1. Go to Native Consoles > Identity Management > Configure > New Managed Object.

  2. Enter the managed object details for the target to store the email communication subscribers for special offers and services. The managed object in this example is called email_offers.

    https://backstage-community-prod.storage.googleapis.com/original/2X/d/d427c0453967be7f37fddc46d2d15c8876d7a930

  3. Add the email property to the email_offers managed object, with the String type.

    https://backstage-community-prod.storage.googleapis.com/original/2X/d/dbde3eea61b8bffd41459ef1a2078e29b6820fe4

  4. Go to Configure > New Managed Object.

  5. Enter the managed object details for the target to store the email notification subscribers for news and updates. The managed object in this example is called email_news.

    https://backstage-community-prod.storage.googleapis.com/original/2X/0/03e05945c2eec5fcfff3bb2dad377f69dc582875

  6. Add the email property to the email_news managed object, with the String type.

    https://backstage-community-prod.storage.googleapis.com/original/2X/a/a3955b711644a05e75e487f5d03ff51f08c74122

  7. Go to Configure > New Managed Object.

  8. Enter the managed object details for the target to store the email notification subscribers for loyalty program updates (loyalty). The managed object in this example is called email_loyalty.

    https://backstage-community-prod.storage.googleapis.com/original/2X/7/7e49873dec732f4888f03bff7b2ca1099c3aa3b0

  9. Add the email property to the email_loyalty managed object, with the String type.

    https://backstage-community-prod.storage.googleapis.com/original/2X/2/2a73a4625ccb7f75fd50cbff8c2f4634bab2e877

  10. Go to Configure > New Managed Object.

  11. Enter the managed object details for the target to store the email notification subscribers for account security alerts and updates. The managed object in this example is called email_security.

    https://backstage-community-prod.storage.googleapis.com/original/2X/d/deb2e4d20099cc2c795b8329877167bef1c919f9

  12. Add the email property to the email_security managed object, with the String type.

    https://backstage-community-prod.storage.googleapis.com/original/2X/b/b00aa1ea7f9e7bc8fc219a3c932829fb17b19024

Create mappings from alpha_user to the target email lists

We’ll create mappings for email_offers, email_news, email_loyalty, and email_security.

Email_offers:

  1. In the Identity Cloud admin UI, go to Native Consoles > Identity Management > Configure > Mappings and click New Mapping.

  2. Create a mapping from alpha_user to email_offers.

  3. In the Properties tab, add property mapping from the source to the target for the following: mail > email.

    TIP: Use Quick Mapping for quick and easy drag-and-drop property mapping.

    https://backstage-community-prod.storage.googleapis.com/original/2X/2/278ac9e58c098ccc2f6cd2cb5399973315afe99f

  4. In the Association tab > Individual Record Validation:

    1. Set the Valid Source to Validate based on user preferences.

    2. Select Send me special offers and services.

    3. Click Save.

      https://backstage-community-prod.storage.googleapis.com/original/2X/7/739617438cfc834aac2b215d0471873f897721e6

  5. In the Association tab > Association Rules:

    1. Select Correlation Queries.

    2. Click Add Correlation Query.

    3. Select the default Link Qualifier.

    4. Click the + icon and select `email `.

    5. Click Submit.

      https://backstage-community-prod.storage.googleapis.com/original/2X/6/60b9ed5948e6aaa167fa1fa2eaa1da08f2993741

  6. Click Save > Save and Don’t Reconcile.

    https://backstage-community-prod.storage.googleapis.com/original/2X/3/35e3ea4c464359f7ba134562c5277259868f7642

  7. In the Behaviors tab, set the Current Policy to Default Actions and click Save.

Email_news:

  1. In the Identity Cloud admin UI, go to Native Consoles > Identity Management > Configure > Mappings and click New Mapping.

  2. Create a mapping from alpha_user to email_news.

  3. In the Properties tab, add property mapping from the source to the target for the following: mail > email.

    TIP: Use Quick Mapping for quick and easy drag-and-drop property mapping.

    https://backstage-community-prod.storage.googleapis.com/original/2X/d/d73689444e8c75c164234211f70fc47820c2339b

  4. In the Association tab > Individual Record Validation:

    1. Set the Valid Source to Validate based on user preferences.

    2. Select Send me news and updates.

    3. Click Save.

      https://backstage-community-prod.storage.googleapis.com/original/2X/2/28b819623cf8d291507d4e003efb70216d8555ac

  5. In the Association tab > Association Rules:

    1. Select Correlation Queries.

    2. Click Add Correlation Query.

    3. Select the default Link Qualifier.

    4. Click the + icon and select `email `.

    5. Click Submit.

      https://backstage-community-prod.storage.googleapis.com/original/2X/6/60b9ed5948e6aaa167fa1fa2eaa1da08f2993741

  6. Click Save > Save and Don’t Reconcile.

    https://backstage-community-prod.storage.googleapis.com/original/2X/b/b812c0d8d805ce0dd4576a262dee1a38aed31986

  7. In the Behaviors tab, set the Current Policy to Default Actions and click Save.

Email_loyalty:

  1. In the Identity Cloud admin UI, go to Native Consoles > Identity Management > Configure > Mappings and click New Mapping.

  2. Create a mapping from alpha_user to email_loyalty.

  3. In the Properties tab, add property mapping from the source to the target for the following: mail > email.

    TIP: Use Quick Mapping for quick and easy drag-and-drop property mapping.

    https://backstage-community-prod.storage.googleapis.com/original/2X/6/646a6ce591aef1c12d4fafb90b14e7c7cb1cd0ce

  4. In the Association tab > Individual Record Validation:

    1. Set the Valid Source to Validate based on custom script.

    2. Add the following JavaScript to add filtering condition based on the custom_loyalty preference selection:

       Source.preferences.custom_loyalty == true

      https://backstage-community-prod.storage.googleapis.com/original/2X/e/e2722d17576b9046fc8ae5181861c3468e0182f4

      c. Click Save.

  5. In the Association tab > Association Rules:

    1. Select Correlation Queries.

    2. Click Add Correlation Query.

    3. Select the default Link Qualifier.

    4. Click the + icon and select `email `.

    5. Click Submit.

      https://backstage-community-prod.storage.googleapis.com/original/2X/6/60b9ed5948e6aaa167fa1fa2eaa1da08f2993741

  6. Click Save > Save and Don’t Reconcile.

    https://backstage-community-prod.storage.googleapis.com/original/2X/6/63b181400ff43769cc013dcad269fdc00e7817b9

  7. In the Behaviors tab, set the Current Policy to Default Actions and click Save.

Email_security:

  1. In the Identity Cloud admin UI, go to Native Consoles > Identity Management > Configure > Mappings and click New Mapping.

  2. Create a mapping from alpha_user to email_security.

  3. In the Properties tab, add property mapping from the source to the target for the following: mail > email.

    TIP: Use Quick Mapping for quick and easy drag-and-drop property mapping.

    https://backstage-community-prod.storage.googleapis.com/original/2X/d/df8872a0cd168b77e3e62e92d041040abf0aa790

  4. In the Association tab > Individual Record Validation:

    1. Set the Valid Source to All records valid. This will sync all source records without filtering, to achieve a forceable email subscription of account security alerts and notifications for all users by default.

    2. Click Save.

      https://backstage-community-prod.storage.googleapis.com/original/2X/5/542c6d35e3cc9dea0a5578113d1130c0bc20a7e6

  5. In the Association tab > Association Rules:

    1. Select Correlation Queries.

    2. Click Add Correlation Query.

    3. Select the default Link Qualifier.

    4. Click the + icon and select `email `.

    5. Click Submit.

      https://backstage-community-prod.storage.googleapis.com/original/2X/6/60b9ed5948e6aaa167fa1fa2eaa1da08f2993741

  6. Click Save > Save and Don’t Reconcile.

    https://backstage-community-prod.storage.googleapis.com/original/2X/c/c29429424f3fbb99e10365f74edf7e2adfd01363

  7. In the Behaviors tab, set the Current Policy to Default Actions and click Save.

Enable preferences for end users

  1. In the Identity Cloud admin UI, go to Hosted Pages and select the Realm Default theme.

  2. Go to Account Pages > select Layout, and select the Preferences option.

    https://backstage-community-prod.storage.googleapis.com/original/2X/2/2ca4181abe56706fef977c5319807df32d732d2a

  3. Click Save.

The Preferences option will now appear on the end user’s Profile page, allowing them to select their communication preferences.

Testing the use case

  1. Using Incognito or Browsing mode, log in to Identity Cloud as an end user.

  2. Click Edit Your Profile.

    https://backstage-community-prod.storage.googleapis.com/original/2X/8/8e78a34cc5b85df3838d844eb8d2a8f1b16c9778

  3. In the Profile dashboard, scroll down to the Preferences section.

    https://backstage-community-prod.storage.googleapis.com/original/2X/d/d762760e7c84579e4891388b8792f403f02c49d4

  4. Toggle the Send me news and updates to On.

    https://backstage-community-prod.storage.googleapis.com/original/2X/0/0e357f75baf0812d8ae22e9e1bb386b04ac0981a

The email address of the test user is automatically synchronized to the target email subscribers list. To verify this

  • In the Identity Cloud admin UI, go to Native Consoles > Identity Management > Manage > Email_News.

https://backstage-community-prod.storage.googleapis.com/original/2X/e/e5f53e75b4453b4f6f0fe1a02bf3d1c08f2e14a6

A user can change their preferences at any time. Once a preference has been removed, their email address will no longer appear in this list.

The user’s email address is always synced to the Email Security list by default, regardless of the user preference selection on security alerts.