The notification of near expiry has incorrect content


There was an issue reported in Angola, and it turned out that it's valid also in the Core project. The notification of near expiry doesn't have correct content anymore. Instead, it contains untranslated strings as subject and body of the email. Please look at the screenshot.

Reproduction steps:

  1. Add to test server's env file a new entry LOT_NEAR_EXPIRY_CRON with a cron expression of checking something like every minute (0 * * * * ?).

  2. Redeploy that test server.

  3. Log in as administrator and change its email address to something for which you can check email.

  4. Go to the API Console for the test server (/referencedata/docs/).

  5. Get an access token for the administrator.

  6. Update a certain lot (PUT /api/lots/af804501-ef41-4367-9733-83b73e7c0a4b) with the following request body:
    "lotCode": "MF2016C",
    "active": true,
    "tradeItemId": "2f32dc9e-5675-46b7-86cf-cce7dcfe9658",
    "expirationDate": "(6 months from today)",
    "manufactureDate": "2016-01-10",
    "id": "af804501-ef41-4367-9733-83b73e7c0a4b"

  7. In about a minute, you should get an email about near expiry.

  8. The notification is sent, but with an incorrect subject and email body.

Expected results:
*Notification shows Product Name, lot information, date of expiry;
*When the user receives a notification, they can click on a link to view the bin card for the close to expiry product;
*Clicking on the second link takes them to an emergency requisition form pre-selected with the facility and program that has no stock;
*Email body text appears as follows:

Email Template
Subject: CLOSE TO EXPIRY Attention Required: <Facility name>, <Product name>
Dear <user_name>:
This email is informing you that the product <Product Name> with lot number <Lot number> in <program name> at <facility name> will expire in 6 months. Its expiration date is <expiration date>.
Login to view the bin card for this product.
View bin card for <orderable name>: <URL to View BIN CARD>
Thank you
– END –






Joanna Bebak


Epic Link