[midPoint] Email Notification
Jason Everling
jeverling at bshp.edu
Wed Oct 29 14:48:45 CET 2014
Thanks for the follow up, the organization attribute would be fine for us
to use. I had tried this out but I cannot get it to save, I get an error
when saving
Caused by: org.xml.sax.SAXParseException; lineNumber: 82; columnNumber: 46;
The entity name must immediately follow the '&' in the entity reference.
Code:
<notificationConfiguration>
<handler> <!-- branch for department 'A' -->
<expressionFilter>
<script>
<code>event.isUserRelated() &&
requestee.getOrganization().size() == 1 &&
requestee.getOrganization().get(0).getOrig() == 'GenEd'</code>
</script>
</expressionFilter>
<accountPasswordNotifier>
<name>New Account Notification</name>
<operation>add</operation>
<status>success</status>
<recipientExpression>
<script>
<code>basic.getExtensionPropertyValue(requestee, 'http://whatever.com/my',
'otherMailbox')</code>
</script>
</recipientExpression>
<subjectExpression>
<script>
<code>"Welcome to the General Education Program"</code>
</script>
</subjectExpression>
<bodyExpression>
<script>
<code>"[IDM] Your username is: " + requestee?.getName()?.getOrig()</code>
</script>
</bodyExpression>
<transport>mail</transport>
</accountPasswordNotifier>
</handler>
<handler> <!-- branch for department 'B' -->
<expressionFilter>
<script>
<code>event.isUserRelated() &&
requestee.getOrganization().size() == 1 &&
requestee.getOrganization().get(0).getOrig() == 'Info'</code>
</script>
</expressionFilter>
<accountPasswordNotifier>
<name>New Account Notification</name>
<operation>add</operation>
<status>success</status>
<recipientExpression>
<script>
<code>basic.getExtensionPropertyValue(requestee, 'http://whatever.com/my',
'otherMailbox')</code>
</script>
</recipientExpression>
<subjectExpression>
<script>
<code>"Welcome to the Information Systems Program"</code>
</script>
</subjectExpression>
<bodyExpression>
<script>
<code>"[IDM] Your username is: " + requestee?.getName()?.getOrig()</code>
</script>
</bodyExpression>
<transport>mail</transport>
</accountPasswordNotifier>
</handler>
<!-- Universal For All
<handler>
<simpleUserNotifier>
... configuration common to all cases ...
</simpleUserNotifier>
</handler>
-->
<mail>
<redirectToFile>/var/log/tomcat7/mail-notifications.log</redirectToFile>
</mail>
</notificationConfiguration>
On Mon, Oct 27, 2014 at 4:11 PM, Pavol Mederly <pavol.mederly at gmail.com>
wrote:
> > 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>
> 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
>> ___________________________________________
>> "Idem per idem - semper idem Vix."
>>
>> _______________________________________________
>> midPoint mailing list
>> 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 listmidPoint at lists.evolveum.comhttp://lists.evolveum.com/mailman/listinfo/midpoint
>
>
>
> _______________________________________________
> midPoint mailing list
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20141029/031794c9/attachment.htm>
More information about the midPoint
mailing list