<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix"><span class=""> > One other question
        about notifications, Can I use conditions like I<br>
        > did for the user templates and mappings, If a attribute is
        this then<br>
        > use this notification and if the attribute is that use this
        other<br>
        > notification?<br>
        <br>
      </span>Actually, notifications can do that.<br>
      <br>
      They were conceived as a flexible, pipes-and-filters
      shaped system.<br>
      <br>
      Each event is passed down the structure of filters/notifiers. In
      the most general case, these form a tree. <br>
      Filters usually block some events ("filtering them out").
      Notifiers process all events that come down to them.<br>
      <br>
      In your situation it could look like this:<br>
      <br>
      - at the root level, send the notification to the following
      branches in parallel:<br>
      -- in branch 1, apply a specific filtering condition (e.g. is the
      user from department A?) and then use a notifier<br>
      -- in branch 2, apply another filtering condition (e.g. is the
      user from department B?) and then use a notifier<br>
      ... etc.<br>
      <br>
      Of course, each branch can present a whole subtree by itself.<br>
      <br>
      The configuration would then like this. (For simplicity, I've
      decided to select branches depending on Organization attribute.
      I'm not sure if we have available any test method in style 'check
      if "A" is among Organizations for a given user', so this sample is
      quite 'dumb' - it expects exactly one Organization and acts upon
      it. You should change it according to your needs.)<br>
      <br>
      <notificationConfiguration><br>
            <handler>        <!-- branch for department 'A'
      --><br>
               <expressionFilter><br>
                  <script><br>
                     <code>event.isUserRelated()
      &amp;&amp; requestee.getOrganization().size() == 1
      &amp;&amp; requestee.getOrganization().get(0).getOrig() ==
      'A'</code><br>
                  </script><br>
               </expressionFilter><br>
               <simpleUserNotifier><br>
                  ... configuration specific to department A ...<br>
               </simpleUserNotifier><br>
            </handler><br>
            <handler>    <!-- branch for department 'B' --><br>
               <expressionFilter><br>
                  <script><br>
                     <code>event.isUserRelated()
      &amp;&amp; requestee.getOrganization().size() == 1
      &amp;&amp; requestee.getOrganization().get(0).getOrig() ==
      'B'</code><br>
                  </script><br>
               </expressionFilter><br>
               <simpleUserNotifier><br>
                  ... configuration specific to department B ...<br>
               </simpleUserNotifier><br>
            </handler><br>
            <handler>    <!-- a universal for all situations
      (including the two above) --><br>
               <simpleUserNotifier><br>
                  ... configuration common to all cases ...<br>
               </simpleUserNotifier><br>
            </handler><br>
            <mail><br>
              
      <redirectToFile>mail-notifications.log</redirectToFile><br>
            </mail><br>
         </notificationConfiguration><br>
      <br>
      (Beware that event.isUserRelated() does not currently work as it
      should. It passes all user, org and role-related events. I'll fix
      that before 3.1 release.)<br>
      <br>
      Best regards,<br>
      Pavol<br>
      <br>
      On 27. 10. 2014 16:55, Jason Everling wrote:<br>
    </div>
    <blockquote
cite="mid:CAFkZXY5DWpQ687cQwNcNSbhB_6fHGaDF3arFC=PLJfWRx7g=pg@mail.gmail.com"
      type="cite">
      <div dir="ltr">Thanks, So we would then use a generic notification
        email for all students/faculty/staff. This is do-able for now
        and is not important at this time. This would be a great feature
        though, I would more than likely use the department attribute so
        for example if the user part of department A then they would
        receive this type of email and if they are part of department B
        then they would get this email.
        <div><br>
        </div>
        <div>Basically at the beginning of each semester we build out
          the accounts, currently using a CSV dump from the student
          system, modifying the spreadhseet, then using powershell to
          create them. After all this happens we use a mail merge in
          Outlook to send out a "Welcome" email stating their accounts
          are provisioned and here is your usernames and temporary
          passwords with other important information.</div>
        <div><br>
        </div>
        <div>JASON</div>
        <div><br>
        </div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Mon, Oct 27, 2014 at 10:39 AM, Ivan
          Noris <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:ivan.noris@evolveum.com" target="_blank">ivan.noris@evolveum.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
            <span class=""><br>
              On 10/27/2014 04:09 PM, Jason Everling wrote:<br>
              > This is working great, Just what I was looking to do,
              I even added the<br>
              > body expression and code which is emailing all the
              information that is<br>
              > needed.<br>
              ><br>
              > One other question about notifications, Can I use
              conditions like I<br>
              > did for the user templates and mappings, If a
              attribute is this then<br>
              > use this notification and if the attribute is that
              use this other<br>
              > notification?<br>
              ><br>
              <br>
            </span>You can use conditions in the expressions (Groovy,
            Javascript) to do<br>
            whatever you want. I'm not aware of using conditions in
            notification<br>
            handlers other than that or using the filters such as
            "operation",<br>
            "status" etc. documented on<br>
            <a moz-do-not-send="true"
              href="https://wiki.evolveum.com/display/midPoint/Notifications"
              target="_blank">https://wiki.evolveum.com/display/midPoint/Notifications</a>
            - but they<br>
            should do most of the tricks.<br>
            <br>
            The feature you are describing is something we'd like to add
            as "email<br>
            templates". We're discussing that feature and planning it,
            yet without a<br>
            specified release date. Is this feature important for your
            deployment?<br>
            Can you please give us an use case? On which attributes you
            would base<br>
            the conditions?<br>
            <br>
            Thank you.<br>
            <div class="HOEnZb">
              <div class="h5"><br>
                Regards,<br>
                Ivan<br>
                <br>
                --<br>
                  Ing. Ivan Noris<br>
                  Senior Identity Management Engineer<br>
                  <a moz-do-not-send="true" href="http://evolveum.com"
                  target="_blank">evolveum.com</a><br>
                  ___________________________________________<br>
                           "Idem per idem - semper idem Vix."<br>
                <br>
                _______________________________________________<br>
                midPoint mailing list<br>
                <a moz-do-not-send="true"
                  href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br>
                <a moz-do-not-send="true"
                  href="http://lists.evolveum.com/mailman/listinfo/midpoint"
                  target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <font size="2"><br>
        <br>
        CONFIDENTIALITY NOTICE:<br>
        This e-mail together with any attachments is proprietary and
        confidential; intended for only the recipient(s) named above and
        may contain information that is privileged. You should not
        retain, copy or use this e-mail or any attachments for any
        purpose, or disclose all or any part of the contents to any
        person. Any views or opinions expressed in this e-mail are those
        of the author and do not represent those of the Baptist School
        of Health Professions. If you have received this e-mail in
        error, or are not the named recipient(s), you are hereby
        notified that any review, dissemination, distribution or copying
        of this communication is prohibited by the sender and to do so
        might constitute a violation of the Electronic Communications
        Privacy Act, 18 U.S.C. section 2510-2521. Please immediately
        notify the sender and delete this e-mail and any attachments
        from your computer. </font><br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>