From: Krzysztof B. <kb...@un...> - 2022-03-01 15:45:02
|
Hi Laura, W dniu 28.02.2022 o 12:57, Laura Hofer pisze: > Hello, > > we are currently trying to change our message management so that it is > handled locally through our configuration and not only through the web > UI. We noticed that we did not find in the documentation how the naming > of the individual messages works in the properties file. In this regard, > we also asked ourselves how we can create different messages of the same > message type. For example, if we want to send different RequestAccepted > messages for users from different areas. > > It would be great if you could help me with my questions. Let me explain that using this simple example: registrationRequestSubmitted.subject.en=New registration request registrationRequestSubmitted.consumer=RegistrationRequestSubmitted registrationRequestSubmitted.notificationChannel=default_email registrationRequestSubmitted.type=HTML registrationRequestSubmitted.bodyFile.en=msgTemplates/registrationRequestSubmitted.html In this example we are defining one message template with id 'registrationRequestSubmitted' (which you can freely choose). consumer defines the 'purpose' of the message, i.e. which Unity flow is using this type of template (and so defines its variables etc). In this case it is RegistrationRequestSubmitted so this message template can be used in registration forms as a template for sending notification about new registration request. body & subject can be in multiple localized variants (in the example in en, you can add .de variant you you want). Body value is just a path to a separate file with the content. type (HTML or PLAIN) defines whether this is plain text template of HTML one. Finally notification channel is one of available transports from Unity. default_email, default_sms are built-in, there is also an advanced option if you implemented your own code to send messages in Groovy (I can provide details if needed) - useful for integration with other mail systems (also allows for externalizing templates). To create 2 templates for the reg request accepted flow: registrationRequestAccepted1.subject.en=Registration request accepted registrationRequestAccepted1.consumer=RegistrationRequestAccepted registrationRequestAccepted1.notificationChannel=default_email registrationRequestAccepted1.type=HTML registrationRequestAccepted1.bodyFile.en=msgTemplates/registrationRequestAccepted-V1.html registrationRequestAccepted2.subject.en=Registration request accepted registrationRequestAccepted2.consumer=RegistrationRequestAccepted registrationRequestAccepted2.notificationChannel=default_email registrationRequestAccepted2.type=HTML registrationRequestAccepted2.bodyFile.en=msgTemplates/registrationRequestAccepted-V2.html We will need to add the above to the manual :-) HTH, Krzysztof |