How to Automate T-minus Emails

Modified on Thu, 04 May 2023 at 10:58 AM

This guide walks through the steps required to automatically send an email to users 10 days before their Migration Slot. There is an additional section at the end for sending the email when the users are moved into a specific workflow process rather than being time-based.

  1. Setup an email template. Administration -> User Migrations -> Email Templates -> Click here to add new item
    1. Email Name: <As required> e.g. "T-minus 10 days"
    2. Subject: <As required> e.g. "Windows 11 Project - 10 days to go..."
    3. Click on the script icon and add the email content. This can be either markdown or HTML.
    4. Click Save Changes
  2. Administration -> Extensions -> Servicing Plans -> User Migration Plans
  3. Service Plans -> New Service Plan
    1. Plan Name: <As required> e.g "T-minus 10 days email", click New Plan
    2. Schedule Settings -> Tick Reset Prior to Run
    3. Service Plan Actions (Publisher) -> Add New Setting
    4. Setup as in screenshot below. Notes:
      Ensure the Target matches the email name exactly
      Set Param to Schedule:[DeployUnitSlotStart - 10 @ 08.00]
  4. Click Validate Plan Actions -> Continue
  5. Should validate OK 
  6. For testing create a Blueprint and add yourself to it
  7. Data Source -> Deselect All User Migrations option
  8. Data Source -> Add the new Blueprint
  9. Add the test user to a Deployment Unit with a start date and end date which include a date seven days from today
  10. Now the test user 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
  11. Administration -> Extensions -> Servicing Plans -> User Migration Plans
  12. At bottom click Reset, Eval, Schedule & Publish
  13. Open the Email Queue
  14. A new email should have been added to the queue to send to the test user
  15. Now we need to ensure the plan only schedules emails to be sent to users being migrated in the near future so that they're not queued up a long way before the migration slot. In the screenshot below the constraint is 13 days before the migration slot. Browse to Service Plan Rules -> Add New Setting:
    Notes:
    1. Criteria value should be at least three days greater that the T-minus time in case it falls on a weekend. In this case it's a T-minus 10 days email, so the criteria is [Today - 13]
    2. The plan should be set to stop scheduling emails 5 days after to "mop up" any late-comers as there may be post-migration content in the email
    3. The email is only generated just before it's sent, NOT when it is queued. This ensures the user gets the latest version of the email
  16. Click Validate Plan Rules
  17. Click Reset, Eval, Schedule & Publish
  18. Check the test user record, Service Plans tab, ensure all logs are as expected
  19. 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



Further Support

If you require further support, please visit ManagementStudio's Service Desk to search the knowledge base or create a new support ticket.