Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Email Generation for different Domains

SanketBhandhari
New Contributor
New Contributor

Hi All,

We are maintaining identities for our client with email generation rule of firstname.lastname@abc.com.

Now client wants to onboard identities from different organization which will be having emails of firstname.lastname@xyz.com.

How this can be handled in Email Generation Rule based on the attribute which we might be using to segregate the identities e.g. any custom property.

We want logic in the manner.

If CP1 = abc then firstname.lastname@abc.com otherwise firstname.lastname@xyz.com.

Regards,

Sanket Bhandhari

12 REPLIES 12

PremMahadikar
Valued Contributor
Valued Contributor

Hi @SanketBhandhari ,

If the domain is saved in customproperty1. Did you try to configure like below:

PremMahadikar_0-1715600636611.png

 

PremMahadikar_2-1715600687101.png

 

If this helps your question, please consider selecting Accept As Solution and hit Kudos

Hi Prem,

Thanks for the reply, but we want generate emails with different domains, email generation rule will not be helpful in this.

We need logic for advance query.

Regards,

Sanket Bhandhari

@SanketBhandhari ,

Okay. Try below logic in advance config

CASE WHEN users.customproperty1='XYZ' THEN CONCAT(users.firstname,users.lastname,'@',users.customproperty1,'.com') ELSE CONCAT(users.firstname,users.lastname,'@abc.com') END

 

If this helps your question, please consider selecting Accept As Solution and hit Kudos

case when users.customproperty31 = 'abc' THEN concat(users.customproperty47,@abc.com) ELSE concat(users.customproperty47,@xyz.com) END

We are using above logic Prem but it is not working out.

Regards,

Sanket Bhandhari

Please share logs


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Here are the logs Rushikesh.

IF(users.customproperty31 = 'abc', CONCAT(users.customproperty47, '@abc.com'), CONCAT(users.customproperty47, '@xyz.com'))


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

It didn't worked Rushikesh.

Attaching logs.

Regards,

Sanket Bhandhari

@SanketBhandhari ,

Please pass the hardcoded value in quotes.

case when users.customproperty31 = 'abc' THEN concat(users.customproperty47,'@abc.com') ELSE concat(users.customproperty47,'@xyz.com') END

 

If this helps your question, please consider selecting Accept As Solution and hit Kudos

Even with the quotes, it didn't worked.

Regards,

Sanket Bhandhari

Murmur
Regular Contributor III
Regular Contributor III

Hi @SanketBhandhari 

I'm expecting you create these users manually.

I'm pretty confident that this will not work, when you create the User directly from Admin > Identity Repository Users. Why? Because during the initial creation CP1 is not set, but it is rather filled, after the User is already created. 

You could try to create a Create User Request form, that already fills CP1 and create the User with that. 

If you create the Users on Import you are better off, assigning the email on import, rather than using the email generation rule.

Just my 2 cents, I hope it helps

Cheers 🙂

 

@SanketBhandhari ,

 

case when users.customproperty31 = 'abc' THEN concat(users.customproperty47,@abc.com) ELSE concat(users.customproperty47,@xyz.com) END
  • The above code works for me. I can create 'xyz' and 'abc' domain emails for newly created users.

PremMahadikar_1-1715696149957.png

  • Please check your input file. I would suggest you use simple .csv file. I checked the logs, as you are passing many columns.
  • My columns were: 
    statuskey,firstname,lastname,systemusername,username,customproperty31,customproperty47
  • Just for testing, please pass all the values
  • And select 'Generate User Email' during import
  • It should work

 

If this helps your question, please Accept As Solution and hit Kudos