[midPoint] Email Notification

Pavol Mederly pavol.mederly at gmail.com
Mon Oct 27 22:11:23 CET 2014


 > One other question about notifications, Can I use conditions like I
 > did for the user templates and mappings, If a attribute is this then
 > use this notification and if the attribute is that use this other
 > notification?

Actually, notifications can do that.

They were conceived as a flexible, pipes-and-filters shaped system.

Each event is passed down the structure of filters/notifiers. In the 
most general case, these form a tree.
Filters usually block some events ("filtering them out"). Notifiers 
process all events that come down to them.

In your situation it could look like this:

- at the root level, send the notification to the following branches in 
parallel:
-- in branch 1, apply a specific filtering condition (e.g. is the user 
from department A?) and then use a notifier
-- in branch 2, apply another filtering condition (e.g. is the user from 
department B?) and then use a notifier
... etc.

Of course, each branch can present a whole subtree by itself.

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.)

<notificationConfiguration>
       <handler>        <!-- branch for department 'A' -->
          <expressionFilter>
             <script>
                <code>event.isUserRelated() && 
requestee.getOrganization().size() == 1 && 
requestee.getOrganization().get(0).getOrig() == 'A'</code>
             </script>
          </expressionFilter>
          <simpleUserNotifier>
             ... configuration specific to department A ...
          </simpleUserNotifier>
       </handler>
       <handler>    <!-- branch for department 'B' -->
          <expressionFilter>
             <script>
                <code>event.isUserRelated() && 
requestee.getOrganization().size() == 1 && 
requestee.getOrganization().get(0).getOrig() == 'B'</code>
             </script>
          </expressionFilter>
          <simpleUserNotifier>
             ... configuration specific to department B ...
          </simpleUserNotifier>
       </handler>
       <handler>    <!-- a universal for all situations (including the 
two above) -->
          <simpleUserNotifier>
             ... configuration common to all cases ...
          </simpleUserNotifier>
       </handler>
       <mail>
<redirectToFile>mail-notifications.log</redirectToFile>
       </mail>
    </notificationConfiguration>

(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.)

Best regards,
Pavol

On 27. 10. 2014 16:55, Jason Everling wrote:
> 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.
>
> 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.
>
> JASON
>
>
>
> On Mon, Oct 27, 2014 at 10:39 AM, Ivan Noris <ivan.noris at evolveum.com 
> <mailto:ivan.noris at evolveum.com>> wrote:
>
>     Hi,
>
>     On 10/27/2014 04:09 PM, Jason Everling wrote:
>     > This is working great, Just what I was looking to do, I even
>     added the
>     > body expression and code which is emailing all the information
>     that is
>     > needed.
>     >
>     > One other question about notifications, Can I use conditions like I
>     > did for the user templates and mappings, If a attribute is this then
>     > use this notification and if the attribute is that use this other
>     > notification?
>     >
>
>     You can use conditions in the expressions (Groovy, Javascript) to do
>     whatever you want. I'm not aware of using conditions in notification
>     handlers other than that or using the filters such as "operation",
>     "status" etc. documented on
>     https://wiki.evolveum.com/display/midPoint/Notifications - but they
>     should do most of the tricks.
>
>     The feature you are describing is something we'd like to add as "email
>     templates". We're discussing that feature and planning it, yet
>     without a
>     specified release date. Is this feature important for your deployment?
>     Can you please give us an use case? On which attributes you would base
>     the conditions?
>
>     Thank you.
>
>     Regards,
>     Ivan
>
>     --
>       Ing. Ivan Noris
>       Senior Identity Management Engineer
>     evolveum.com <http://evolveum.com>
>       ___________________________________________
>                "Idem per idem - semper idem Vix."
>
>     _______________________________________________
>     midPoint mailing list
>     midPoint at lists.evolveum.com <mailto:midPoint at lists.evolveum.com>
>     http://lists.evolveum.com/mailman/listinfo/midpoint
>
>
>
>
>
> CONFIDENTIALITY NOTICE:
> 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.
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20141027/ea121472/attachment.htm>


More information about the midPoint mailing list