TABLE OF CONTENTS
- Introduction
- 1. Auto-Sending the Self-Scheduling Email
- 2. Auto-Sending a T-Minus 10 Email
- Reference
- Further Support
Introduction
A common use case when managing a transformation projects is to be able to send emails on a schedule. This article covers two scenarios:
- Auto-Sending the Self-Scheduling Email
The user has been added to a Deployment Unit, but does not have a migration slot. In this case it's necessary to send the user a self-scheduling email so that they can choose their migration slot. - Auto-Sending a T-Minus 10 Email
The user has chosen their migration slot and follow up comms need to be sent.
1. Auto-Sending the Self-Scheduling Email
When planning Deployment Units, it's important to consider the timing of the self-scheduling email. This email includes a booking link that allows users to select a migration slot within their assigned Deployment Unit. The ESM plan must cater for two scenarios:
Standard Timing: Deployment teams typically require this email to be sent 1–2 weeks before the start of the Deployment Unit. This ensures users have enough time to book their slot in advance. The example here is to send the email 2 weeks before.
Late Additions: If a user is added to a Deployment Unit after deployments have begun.
Schedule Settings
The emails sent by this ESM Plan will be begin to be sent at the time the plan runs, and be spread over two hours. It's therefore recommended that the plan is set to run daily at midday.
The email should only be sent to each user once, so Always Re-Run ESM Plan should not be ticked.
For testing leave the Schedule To Run At #1 blank.
Service Plan Rules (Evaluator)
Rule Name | Rule Type | Data Location | Operator | Criteria |
---|---|---|---|---|
Up to 14 days before | Field | DeployUnitStartDate | <= | [Today + 14] |
During Deployments | Field | DU:EndDate | >= | [Today] |
User not booked already | Field | DeployUnitSlotStart | == | [blank] |
Limit to test DU | Field | DU:DeployUnit | == | Test DU |
Rule 1: This will cater for User Migrations who are in a DU which has a start date within 14 days from the current day. This will cater for people who were either added to the DU at least 14 days before the DU start date, or for people who were added within 14 days of the start date.
Rule 2: This is for User Migrations who are added to the DU once the start date has passed, but before the end date of the DU. It ensure these people don't miss out on the email.
Rule 3: Ensures the user does not have a slot booked already.
Rule 4: Limits the ESM Plan to only run against users in the test Deployment Unit
Plan Actions
Event | Action | Target | Param |
---|---|---|---|
On Publish | Send Email | Self-Schedule - Request Email | Schedule:[TimeStamp] |
This will start to send the emails when the ESM Plan runs, and spread them over the default time period (two hours).
Test the Plan
Setup a test Deployment Unit called Test DU with User Migrations as the Target and a start date 10 days in the future.
Add a test User Migration to this DU, and ensure they don't have a migration slot.
In the ESM Plan click Run Plan Evaluator and ensure there is only 1 pass in the log.
Click Clear History, Run Eval, Schedule & Publish.
Check the Action Log. There should be 1 item Completed.
Check the Email Queue. A Self-Scheduling Email should be sent to the test user. Note that the built-in deduplication check may prevent this if this email has already been sent.
- Once it's all setup and working remove Rule 4 from the Service Plan Rules and set Schedule to Run #1 under Schedule Settings as required.
2. Auto-Sending a T-Minus 10 Email
Prepare Prerequisites
- For testing create a Blueprint and add a test User Migration to it
- Setup an email template. Administration -> User Migrations -> Email Templates -> Click here to add new item
- Email Name: <As required> e.g. "T-minus 10 days"
- Subject: <As required> e.g. "Windows 11 Project - 10 days to go..."
- Click on the script icon and add the email content. This can be either markdown or HTML.
- Click Save Changes
Create the ESM Plan
- Administration -> Extensions -> Servicing Plans -> User Migration Plans
- Service Plans -> New Service Plan
- Plan Name: <As required> e.g "T-minus 10 days email", click New Plan
- Schedule Settings -> Tick Reset Prior to Run
- Data Source -> Deselect All User Migrations option
- Data Source -> Only run on User Migrations in the test Blueprint
- Add the test User Migration to a Deployment Unit with a start date and end date which include a date seven days from today
- Now the test User Migration needs a migration slot: User Migrations -> All User Migrations -> Double click your user record -> click Update Migration Slot -> Set the migration slot to 7 days in the future from today -> Update
- Now we need to ensure the plan only runs against the relevant User Migrations. In the screenshot below the Evaluator is searching for users who are being migrated in the next 13 days (it's 13 rather than 10 to ensure emails aren't sent on a weekend, but rather the Friday before).
- Browse to Service Plan Rules -> Add New Setting:
- Add the two rules below:
- Notes:
- Rule 1: The Criteria search start date should be set to [Today] to catch late additions to the schedule. I.e. If a user was scheduled to be migrated three days from [Today], they should still receive the email.
- Rule 2: This defines the search end date. The Criteria should be at least three days greater that the T-minus time in case it falls on a weekend, in which case the email will be sent on the Friday before. In this case it's a T-minus 10 days email, so the criteria is [Today + 13]
- The email Schedule date (the date the email is actually sent) is dictated by the Plan Actions (not the evaluator rules) which in this case will always be 10 days prior to the migration date. This is configured in a later step. The email queue will therefore show a set of emails scheduled to be sent in the near future for users being migrated in the next 10 days.
- The email content is generated at the time the email is sent, NOT when it is queued. This ensures the user gets the latest version of the email.
- It is possible to combine the two rules into a single rule. For examples see the Reference section below.
- Click Validate Plan Rules and ensure they pass
- Now the action must be created. In Service Plan Actions (Publisher) click Add New Setting
- Setup as in screenshot below.
Ensure the Target matches the email name exactly
Set Param to Schedule:[DeployUnitSlotStart - 10 @ 08:00];DuplicateCheck:100;LateEmailLimit:10
Notes:- The DuplicateCheck setting ensures that duplicate emails are not sent. Set this to at least the t-minus days
- The LateEmailLimit setting ensures that emails with a scheduled send date which is a long time in the past are not sent in error. Set this to the t-minus days.
Click Validate Plan Actions and ensure it passes
Sae the plan
Test the Plan
Click Clear History, Run Eval, Schedule & Publish
Check the test User Migration, Service Plans tab, ensure all logs are as expected
- Once it's all setup and working remove the test Blueprint from the plan source (it may be useful to target a specific process for production) and set a Schedule to Run under Schedule Settings as required
Reference
Rule Name | Rule Type | Data Location | Operator | Criteria | Description |
---|---|---|---|---|---|
Has a date set | Field | DeployUnitSlotStart | != | [Blank] | Identifies all assets which have been added to a slot in the DU |
Has no date set | Field | DeployUnitSlotStart | == | [Blank] | Identifies all assets which have not been added to a slot in the DU |
More than 10 days to go (Inclusive) | Field | DeployUnitSlotStart | >= | [Today + 10] | Identifies all assets with more than 10 days until they are due to be migrated |
Less than 10 days to go (Inclusive) | Field | DeployUnitSlotStart | <= | [Today + 10] | Identifies all assets with less than 10 days to go until they are due to be migrated |
More than 10 days ago (Inclusive) | Field | DeployUnitSlotStart | >= | [Today - 10] | Identifies all assets which have a migration slot more than 10 days ago |
Less than 10 days ago (Inclusive) | Field | DeployUnitSlotStart | <= | [Today - 10] | Identifies all assets which have a migration slot less than 10 days ago |
In the future | Field | DeployUnitSlotStart | > | [TimeStamp] | Identifies all assets which are due to be migrated in the future |
In the past | Field | DeployUnitSlotStart | < | [TimeStamp] | Identifies all assets which have a migration slot in the past |
Is Between 5 & 10 Days to go | Field | DeployUnitSlotStart | Is the Day | Between [Today + 5] & [Today + 10] | Identifies all assets which are due to be migrated between 5 days and 10 days in the future |
Not Between 5 & 10 Days to go | Field | DeployUnitSlotStart | Not the Day | Between [Today + 5] & [Today + 10] | Identifies all assets which are not due to be migrated between 5 days and 10 days in the future (Eg. a user who is due to be migrated tomorrow; a machine which is due to be migrated in 12 days' time, any asset which has a slot in the past) |
Is Between 5 & 10 Days ago | Field | DeployUnitSlotStart | Is the Day | Between [Today - 5] & [Today - 10] | Identifies all assets which have a migration slot between 5 days and 10 days ago |
Not Between 5 & 10 Days ago | Field | DeployUnitSlotStart | Not the Day | Between [Today - 5] & [Today - 10] | Identifies all assets which do not have a migration slot between 5 days and 10 days ago (Eg. a user with a migration slot 15 days ago; a machine which is due to be migrated in 2 days' time) |
Three days to go between 1pm & 7pm | Field | DeployUnitSlotStart | Is the Day | Between [Today + 3 @13:00] & [Today + 3 @19:00] | Identifies all assets which are due to be migrated in 3 days' time, between 1pm and 7pm |
Three days ago between 1pm & 7pm | Field | DeployUnitSlotStart | Is the Day | Between [Today - 3 @13:00] & [Today - 3 @19:00] | Identifies all assets which have a migration slot 3 days' ago, between 1pm and 7pm |
DeployUniitStart = 2021-01-25 | Field | DeployUnitSlotStart | Is the Day | 25/01/2021 | Identifies all assets which are due to be migrated on the 25/01/2021 |
Compare two dates | Compare Fields | DeployUnitSlotStart | <= | DU:EndDate | Identifies all assets which have a slot which falls in between two dates |
Further Support
If you require further support, please visit ManagementStudio's Service Desk to search the knowledge base or create a new support ticket.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article