0 votes

Dear,

When a new user is created by HR, I would like to send an e-mail to the manager of the new created user.
I've created a webform for managers to edit some properties for a user.

It would be nice if the e-mail notification contains a link to the weform for the managers, and automatically the new user is selected.

Is this possible in an e-mail notification?

Kind regards.

by (140 points)

1 Answer

0 votes
by (267k points)
selected by
Best answer

Hello,

Yes, it is possible using a Business Rule triggering After Creating a User and a PowerShell script. The script will form the URL based on the new user data and the URL to the Home Page Action.
i. Getting the Home Page Action URL

  1. Sign in to the Web interface.
  2. On the Home page, click the Modify User action you need.
  3. Copy the URL from the browser (e.g. http://example.com/AdaxesAdmin/HomeActi ... c8f4118c49)

ii. Creating the Business Rule

  1. Launch Adaxes Administration Console.

  2. Right-click your Adaxes service node, navigate to New and click Business Rule.

  3. On step 2 of the Create Business Rule wizard, select User Object type.

  4. Select After Creating a User and click Next.

  5. Click Add Action.

  6. Select Run a program or PowerShell script.

     $homePageActionUrl = "http://example.com/AdaxesAdmin/HomeAction.aspx?id=366c3fb2-f754-450c-a27a-f8c8f4118c49"
    
     # E-mail settings
     $to = "%adm-ManagerEmail%" # TODO: modify me
     $subject = "MySubject" # TODO: modify me
     $htmlTemplate = "
     <h2>Hello %adm-ManagerFullName%,</h2><br/>
     <a href='$homePageActionUrl`&path={0}'>Click to modify %fullname%</a>
    
     <hr /><p><i>Please do not reply to this e-mail, it has been sent to you for notification purposes only.</i></p>" # TODO: modify me
    
     # Build HTML
     $path = [System.Web.HttpUtility]::UrlEncode($Context.TargetObject.AdsPath)
     $html = [System.String]::Format($htmlTemplate, $path)
    
     # Send mail
     $Context.SendMail($to, $subject, $NULL, $html)
    

  7. Paste the below script into the Script field.
    In the script, the $homePageActionUrl variable specifies the URL to your Home Page Action. Replace the variable value in the script with the one you copied on step 3 of the Getting the Home Page Action URL section.

  8. Enter a short description and click OK.

  9. Click Next and finish creating the Business Rule.

Related questions

0 votes
1 answer

Is it possible when sending the email notification to include all recipients in a single email instead of individual emails going out to each user? Thanks

asked Nov 1, 2018 by cory.fiala (50 points)
0 votes
0 answers

Hi, This normally works, and running the email test comes back successful. One user I created though, the step timed out. I am wondering if it's because for this user, one of ... you leave a variable in but not have it time out if the variable doesn't exist?

asked Jul 15, 2016 by AdamFowlerIT (120 points)
0 votes
1 answer

Hi Forum, is it possible to disable the email notification for all actions in Approval Requests? Thanks a lot

asked Nov 18, 2015 by esoAdxAdmin (650 points)
0 votes
1 answer

Hello, I need some advice. I'd like to create a specific After user creation action, but I don't know exactly how. In our environment a new user need to assign a MS365 ... 313/create-user-mailbox-in-office-365 Will it work in 2020? Thank you for your answer.

asked Dec 14, 2020 by the7thever (50 points)
0 votes
1 answer

I want to send an e-mail (after create user job) with the password visible, how to do that? Remco

asked Jan 13, 2014 by RTiel (780 points)
3,293 questions
2,991 answers
7,664 comments
544,159 users