Sending a welcome email after Mailbox created

I’ve scripted a PowerShell connector to create Exchange mailboxes. That works fine. However I’d like to also send a user a Welcome email after the mailbox is created. The problem is timing - the mailbox can take some time to get fully created on the Exchange server so if I send that email as an onCreate event, that’s too early - I need to wait up to 30 seconds before I send the email. There’s a couple ways I was thinking of doing this and I was looking for feedback:

  1. In the onCreate task, create a new workflow task with a 30 second timer that then sends the email
  2. In the onCreate task, call a groovy script that waits 30 seconds on a background thread and then sends the email. I haven’t tried this yet to know if it will actually work.

Any other suggestions on how to do this?

Hi Craig,

I would like to investigate this further for you and see if there are any other suggestions. To better understand the current context, could you please confirm whether you have already attempted to call the Groovy script that waits for 30 seconds on a background thread? This will help provide more tailored guidance.

Cheers,
Sheila

The groovy engine didn’t appear to have the required functionality to do background threads. If I put the wait on the foreground thread, all processing halted until the wait completed. In the end I created a workflow with two tasks: 1) wait 2) send the welcome email. That works perfectly.

1 Like

Hi Craig,
I appreciate you taking the time to inform me. I’m glad to hear that you found a suitable solution! Separating the wait task and send task was a smart approach to eliminating the timing bottleneck. Well done!

Thank you for sharing your solution with the community and providing an update. It’s always helpful to learn from real-world examples and experiences. Your contribution is greatly appreciated!