Forum Discussion

Nolan_Jensen_23's avatar
Nolan_Jensen_23
Icon for Nimbostratus rankNimbostratus
Jan 18, 2019

APM Variable assign to change email attribute?

Hello,

 

Does any one know the best way to do a custom variable assign to modify the ending of our mail attribute to always be the same thing?

 

The problem we have is we allow multiple domains as our default email for users but when trying to authenticate to a hosted site using email address it won't match for some users.

 

I got help a while ago on here and was told how to convert a specific email domain to another but now I need to convert at least 10 different emails to a single domain.

 

Here is how I was able to convert one email domain to another but not sure how to adapt that to many. string map {@test.org @example.org} [string tolower [mcget {session.ad.last.attr.mail}]]

 

Now I need to convert around 10 different domains to @example.org. Note all of them are different names so just made up a few examples

 

@john.org

 

@smith.org

 

@joey.org

 

  • Use string map with list command:

    string map -nocase [list John.org @example.org @smith.org @example.org @joey.org @example.org] [string tolower [mcget {session.ad.last.attr.mail}]]