4 Replies Latest reply: Dec 24, 2012 6:23 AM by user559503 RSS

    How to send create user notification template using scheduled task

    user559503
      Hi All,

      I have a requirement where in I need to send the notification of Create User Notification Template which is sent when a new user is created. I have written a custom scheduled task for the same. In that I call the PasswordManagementService method resetPassword. It works but the problem is it sends the Reset Password mail. But I need the create user mail to be sent. Is there some other API function for the same? Or maybe there is some other way to achieve this? Please guide me urgently.

      Thanks,
      $id
        • 1. Re: How to send create user notification template using scheduled task
          Nishith Nayan
          http://fusionsecurity.blogspot.in/2011/07/oim-11g-notifications.html
          • 2. Re: How to send create user notification template using scheduled task
            user559503
            Hi Nishith,

            Thanks for that link. Its very helpful. Can you please also suggest as to how I could set other attributes such as first name, last name and user password in the notification? I think the sample example there only talks about user login attribute. Or i might be wrong. Also to achieve this, do i need to add these attributes in the static data of the initial event XML?

            Thanks,
            $id
            • 3. Re: How to send create user notification template using scheduled task
              user559503
              Hi Nishith,

              I created a java file for the resolver class exactly with the code in the link you pasted here. Then registered it as plugin as per the link's documentation. Then went to the ResetPasswordNotification.xml which is present in MDS by default and edited it to refer the Resolver Class I created above. However now when I reset password, no attribute is getting resolved. All come as $userLogin, $firstName and so on. Can you please suggest what to do in this case?

              Thanks,
              $id
              • 4. Re: How to send create user notification template using scheduled task
                user559503
                There is some problem in the getReplacedData method of the code. The user login is coming as null as per the logs I have set.

                ---------------------------------------------------------------------------------------------------------------------
                public HashMap<String, Object> getReplacedData(String eventType, Map<String, Object> eventParams) throws Exception {

                HashMap<String, Object> resolvedNotificationData = new HashMap<String, Object>();

                UserManager usrMgr = Platform.getService(UserManager.class);

                //getting the notfication parameter
                String userLogin = (String) eventParams.get("user_login");

                // Mapping token with their actual value for user attributes.
                if (userLogin != null) {
                ----------------------------------------------------------------------------------------------------------------------

                Since the user login is null, no processing takes place I presume.

                Thanks,
                $id