You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@syncope.apache.org by "justinkildeafinn@gmail.com" <ju...@gmail.com> on 2018/07/16 14:11:52 UTC

New user notification

I am looking to send a new user notification when a /users/self request is
accepted/activated by an admin in the console.
Ultimately I'd like to include a token and password reset link.

I spent some time with the notifications and experimented with the
Logic:UserLogic options among some others and found that a notification
could be triggerd on "Delete", but "Create" was not the right action in this
case - if I want to trigger a notification on user activation.

I had a look at the password reset and confirmation emails, but is there a
prefered method for setting up a welcome email notification using an
existing Logic action, or should this require a custom action like the
password reset does?

This may be covered in the documentation and I just missed it - if so, could
you point me in the right direction? Maybe an example or some core concepts
I should get to know first?

Thanks for your help.

--
Sent from: http://syncope-user.1051894.n5.nabble.com/

Re: New user notification

Posted by Francesco Chicchiriccò <il...@apache.org>.
On 20/07/2018 04:47, justinkildeafinn@gmail.com wrote:
> Hi Dima, thank you for your reply.
>
> Is there a reference that includes a more detailed description of how to use
> the notifications? If I add a notification after the createApproval I am
> still not clear on what I am triggering the notification with. As an
> example, the reset password notification occurs on the
> [CUSTOM]:[]:[]:[requestPasswordReset]:[SUCCESS] event. Is there a custom
> event I should be referring to?
>
> For the password reset I can see the /confirmPasswordReset rest operation,
> so I can see why we use it there, but for the case of the createApproval it
> is not obvious to me what operation I should be using to create the
> notification.
>
> Is some more detailed notifications documentation available?

Hi,
have you already found [1] and [2] in particular, which explains the 
events mechanism?

Custom events (as the one you report above for password reset) are 
explicitly triggered by code; standard events are instead automatically 
triggered by the execution of certain predefined actions.

Standard events cover things like as user login, propagation to external 
resources, pull task execution, etc.

In your own case - notification upon user activation - I would:

1. extend the workflow definition as suggested by Dima
2. attach a ServiceTask to the transition to the 'active' state (e.g. 
after approval), where you trigger the custom notification: see [3] as 
an example of how to invoke the notificationManager to trigger a given 
notification

Supposing that you define a Notification for the

[CUSTOM]:[]:[]:[userActivated]:[SUCCESS]

event, then you can trigger it from code as

             notificationManager.createTasks(
                     AuditElements.EventCategoryType.CUSTOM,
                     null,
                     null,
                     "userActivated",
                     AuditElements.Result.SUCCESS,
                     userTO,
                     null,
                     null);

HTH
Regards.

[1] http://syncope.apache.org/docs/reference-guide.html#notifications
[2] http://syncope.apache.org/docs/reference-guide.html#notification-events
[2] 
https://github.com/apache/syncope/blob/2_1_X/core/workflow-flowable/src/main/java/org/apache/syncope/core/workflow/flowable/task/Notify.java#L51-L59

-- 
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/


Re: New user notification

Posted by "justinkildeafinn@gmail.com" <ju...@gmail.com>.
Hi Dima, thank you for your reply.

Is there a reference that includes a more detailed description of how to use
the notifications? If I add a notification after the createApproval I am
still not clear on what I am triggering the notification with. As an
example, the reset password notification occurs on the
[CUSTOM]:[]:[]:[requestPasswordReset]:[SUCCESS] event. Is there a custom
event I should be referring to? 

For the password reset I can see the /confirmPasswordReset rest operation,
so I can see why we use it there, but for the case of the createApproval it
is not obvious to me what operation I should be using to create the
notification.

Is some more detailed notifications documentation available?

Thank you for your help.

--
Sent from: http://syncope-user.1051894.n5.nabble.com/

Re: New user notification

Posted by Dima Ayash <di...@apache.org>.
Dear,

You can take a look to the workflow test in [1], where you can find the 
create approval. You need to change the workflow adding the notification 
after the approval.

[1] 
https://github.com/apache/syncope/blob/2_0_X/fit/core-reference/src/main/resources/userWorkflow.bpmn20.xml

Best regards,


On 07/16/2018 04:11 PM, justinkildeafinn@gmail.com wrote:
> I am looking to send a new user notification when a /users/self request is
> accepted/activated by an admin in the console.
> Ultimately I'd like to include a token and password reset link.
>
> I spent some time with the notifications and experimented with the
> Logic:UserLogic options among some others and found that a notification
> could be triggerd on "Delete", but "Create" was not the right action in this
> case - if I want to trigger a notification on user activation.
>
> I had a look at the password reset and confirmation emails, but is there a
> prefered method for setting up a welcome email notification using an
> existing Logic action, or should this require a custom action like the
> password reset does?
>
> This may be covered in the documentation and I just missed it - if so, could
> you point me in the right direction? Maybe an example or some core concepts
> I should get to know first?
>
> Thanks for your help.
>
> --
> Sent from: http://syncope-user.1051894.n5.nabble.com/

-- 
Dima Ayash

Tirasa - Open Source Excellence
http://www.tirasa.net/

Member at The Apache Software Foundation
Syncope