Altinn / altinn-notifications

Altinn platform microservice for handling notifications (mail, sms, etc)
MIT License
2 stars 3 forks source link

Support for placeholder keywords for dynamic changes in texts based on recipient #545

Open SandGrainOne opened 5 months ago

SandGrainOne commented 5 months ago

Description

We want the Notifications service to have solid support for having multiple independent recipients in a single order. This means the texts needs to have some basic support for personalization based on recipient. Like addressing the recipient by name.

There needs to be way for service owners to make smaller recipient specific adjustments to the content of notifications. The feature here should be a search and replace in texts

Keywords copied from Altinn 2 and adjusted for Altinn 3:

Keyword Description
$recipientFirstName$ The first name of a person *
$recipientMiddleName$ The middle name of a person *
$recipientLastName$ The surname of a person *
$recipientName$ The full name of the recipient, support both person and organization.
$recipientNumber$ The organization number when recipient is an organization. Left empty if recipient is a person.

Example

A simple request with personalized texts:

{
    "subject": "Happy birthday $recipientFirstName$!",
    "body": "Hi $recipientFirstName$, remember to never click any links in emails!",
    "recipients": [
        {
            "nationalIdentityNumber": "18874198354"
        }
    ]
}

There is a new specialized endpoint in Register that should provide what we need: register/api/v1/parties/nameslookup See issue: #593

Additional Information

The source of the keyword list above is inspired by Altinn 2 documentation: List of Varselmakroer. The list is curated down to a list of keywords actually being used in Altinn 2.

Refinement

Tasks

Acceptance criteria

olebhansen commented 3 months ago

Pending a suitable endpoint to surce data from (#589 #593 )

SandGrainOne commented 3 months ago

Updated the list of keywords we're going to support after the #604 analysis.

Ahmed-Ghanam commented 10 hours ago

26.11.2024
During a meeting to assess our requirements, we made the following decisions:

Action point: