From 5acb85f0f0781c0eb9a5991e892d574eb4f6cf5d Mon Sep 17 00:00:00 2001 From: Yuvraj Rimal Date: Wed, 18 Oct 2023 18:11:04 -0400 Subject: [PATCH 1/2] 1207 update start_from, Update schedules.md Update schedules document to include update on start_from. --- .../apps/reference/app-settings/schedules.md | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/content/en/apps/reference/app-settings/schedules.md b/content/en/apps/reference/app-settings/schedules.md index 6230d1666..fbdcf9cea 100644 --- a/content/en/apps/reference/app-settings/schedules.md +++ b/content/en/apps/reference/app-settings/schedules.md @@ -21,7 +21,7 @@ The `schedules` key contains an array of schedule objects, each representing the |`name`|A unique string label that is used to identify the schedule. Spaces are allowed.|yes| |`summary`|Short description of the of the schedule.|no| |`description`|A narrative for the schedule.|no| -|`start_from`|The base date from which the `messages[].offset` is added to determine when to send individual messages. You could specify any property on the report that contains a date value. The default is `reported_date`, which is when the report was submitted.|no| +|`start_from`|The base date from which the `messages[].offset` is added to determine when to send individual messages. You could specify any property on the report that contains a date value. Starting 4.5.0, array of property names is also supported; in this case, first non-undefined field is used. The default is `reported_date`, which is when the report was submitted.|no| |`start_mid_group`|Whether or not a schedule can start mid-group. If not present, the schedule will not start mid-group. In other terms, the default value is `false`|no| |`messages`|Array of objects, each containing a message to send out and its properties.|yes| |`messages[].translation_key`|The translation key of the message to send out. Available in 2.15+.|yes| @@ -57,3 +57,25 @@ This sample shows a schedule with a single message, which will be sent on Monday } ] ``` + +Following sample schedules a message for 270 days from `lmp_date`. If `lmp_date` doesn't exist on report, it will schedule a message for 270 days from `fields.lmp_date`. If both fields don't exist, it will create schedule from `reported_date`. This feature on `start_from` is supported from CHT 4.5.0+. + +```json + "schedules": [ + { + "name": "Delivery Reminder", + "summary": "", + "description": "", + "start_from": ["lmp_date", "fields.lmp_date"], + "start_mid_group": true, + "messages": [ + { + "translation_key": "messages.schedule.deliery", + "group": 1, + "offset": "270 days", + "recipient": "reporting_unit" + } + ] + } +] +``` From 606efcabbf19a00f0c80f7f765d29ecb7766faa6 Mon Sep 17 00:00:00 2001 From: Yuvraj Rimal Date: Thu, 19 Oct 2023 09:32:02 -0400 Subject: [PATCH 2/2] Address pr feedback and correct behavior --- content/en/apps/reference/app-settings/schedules.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/apps/reference/app-settings/schedules.md b/content/en/apps/reference/app-settings/schedules.md index fbdcf9cea..929481005 100644 --- a/content/en/apps/reference/app-settings/schedules.md +++ b/content/en/apps/reference/app-settings/schedules.md @@ -21,7 +21,7 @@ The `schedules` key contains an array of schedule objects, each representing the |`name`|A unique string label that is used to identify the schedule. Spaces are allowed.|yes| |`summary`|Short description of the of the schedule.|no| |`description`|A narrative for the schedule.|no| -|`start_from`|The base date from which the `messages[].offset` is added to determine when to send individual messages. You could specify any property on the report that contains a date value. Starting 4.5.0, array of property names is also supported; in this case, first non-undefined field is used. The default is `reported_date`, which is when the report was submitted.|no| +|`start_from`|The base date from which the `messages[].offset` is added to determine when to send individual messages. You could specify any property on the report that contains a date value. Starting from 4.5.0, an array of property names is also supported; in this case, the first defined field is used. The default is `reported_date`, which is when the report was submitted.|no| |`start_mid_group`|Whether or not a schedule can start mid-group. If not present, the schedule will not start mid-group. In other terms, the default value is `false`|no| |`messages`|Array of objects, each containing a message to send out and its properties.|yes| |`messages[].translation_key`|The translation key of the message to send out. Available in 2.15+.|yes| @@ -58,7 +58,7 @@ This sample shows a schedule with a single message, which will be sent on Monday ] ``` -Following sample schedules a message for 270 days from `lmp_date`. If `lmp_date` doesn't exist on report, it will schedule a message for 270 days from `fields.lmp_date`. If both fields don't exist, it will create schedule from `reported_date`. This feature on `start_from` is supported from CHT 4.5.0+. +The following sample schedules a message for 270 days from `lmp_date`. If `lmp_date` doesn't exist on report, it will schedule a message for 270 days from `fields.lmp_date`. If neither field exists, it will not create a schedule. Using an array for `start_from` is supported from CHT 4.5.0+. ```json "schedules": [