Altinn/altinn-notifications

Add a capability to obtain contact information for a person when notification is about to be sent

Closed this issue · 1 comments

Description

The Notification component should be able to identify an email address and/or mobile number when the intended recipient of a notification is a person. The logic can do this using an instance of IProfileRetriever to obtain profile information. There are currently one implementation of the interface called ProfileClient that can retrieve a UserProfile from the Profile component.

The UserProfile is populated with an email address and phone number from KRR (Contact and reservation register)

As of writing this issue I think that the SblBridge-Profile integration ignores reservations against digital communication with the government. If this is unacceptable for this feature we need to make changes to SblBridge and Profile.

  1. The profile lookup should occur at the time when the notification is to be sent.
  2. It should be unnecessary to do a lookup if the notification already have a target with an address.
  3. The lookup is done only if the Notification.PartyReference is filled in with an (SSN - National Identity Number)
    Other issues will cover lookup based on other values and properties like InstanceId.

Considerations

I would like to restart the discussion around the use of Target as the primary entity when notifications are to be sent. When the time for a notification to be sent comes along we still don't know how many targets we will need. This is especially true for notifications where the intended recipients are people associated with an organization. If we end up creating 5 new targets it feels wrong that it was all started with a single Target id.

One of the reasons for why we went for using Target as primary entity was the need to separate the processing of email and sms notifications. It makes it possible to have one job/function for email and another one running at a different schedule for sms. This could be used to respect the "sending window" for sms.

Another way of solving that issue could be to add a second column for sending of notifications. The original column would be when the user/application owner wants the notification to be sent. The other date is when the notification component thinks it will be able to send it. This could be used to postpone notifications that have only sms Targets left.

Ops requirements

This change should not require any ops changes.

Acceptance criteria

Specification tasks

  • Development tasks are defined

Development tasks

Test

Definition of done

  • Documentation (docs.altinn.studio) is updated (if relevant)
    • Technical documentation
    • User documentation
  • QA
  • Manual test is complete (if relevant)
  • Automated test is implemented (if relevant)
  • All tasks in this userstory are closed (i.e. remaining tasks are moved to other user stories or marked obsolete)

Duplicate of #203