...building hybrid clouds that can support any device from anywhere
So, you want to send email leveraging Orchestrator activities to jazz up some of your automation? This blog post will focus on a couple of ways to accomplish this. In fact, this is a nice way to add some finishing touches on any user facing communication that may be executed within your IT process automation. After all, pictures are really worth a thousand words. Well – maybe not a thousand but you get the idea .
Well, great question. Let’s suppose you have an email you want to send out that is rich in graphics – maybe a “how to” document on using SharePoint or XYZ internal expense application. Graphics help tell the story. The below process pulls the details together to get this done.
This first example is going to concentrate on the System Center 2012 SP1 – Orchestrator Integration Pack provided for Microsoft Exchange called the Exchange Users Integration Pack for Orchestrator in System Center 2012 SP1. If you haven’t already gone out and grabbed this, registered and deployed it to your environment, this is a pre-requisite for what I’m about to show you. So – Go get it, follow the detailed instructions and set it up!
To keep this very simple, I’m going to show you (2) activities. One sets the published data for the end user you are emailing, the next sends the email.
It’s this simple – request an email address to send to and let the next activity uses it as dynamic Published Data.
Now we modify the Create and Send Welcome Message activity
Note: I highlighted the “IMG” stuff to show you how you can reference graphics published on your internal websites as graphics to embed into email. What’s better, you can update these graphics in one place and you don’t have to modify your content in Orchestrator. Even better – it is secure because it is referencing internal data only accessible by your users if they are on your Corporate Network.
Example HTML Source exchange-html-source.zip
Here’s what you get for all your effort (my example of course) .
Found under the “Runbook Control” section of activities, Invokes allow you to place values in your Runbook to call another Runbook and populate the parameters that are discussed later on in this post.
Note: Your called Runbook must be checked in to see the latest parameter data. If you can’t see parameters, check it in and try again.
You can get as creative and dynamic as you want regarding the use of Published Data. The point is this can be as flexible as you need it. Want to paste the URL data dynamically instead of hardcoding it in the Exchange Activity? No problem.
Simply add a couple more parameters like “HTML Data” and “Subject” to the mix so you can take in HTML data as Published Data – this makes this activity useful for lots of scenarios.
Go through and update each piece of “hard coded” data into dynamic Published Data and Voila! All dynamic!
Place the data you need in Subject and HTML Data boxes, check it in and try it out!
Well – there is an option to add base64 email encoded graphics into your email message. I will give you a piece of advice up front – this is a hit and miss from what I’ve seen and not supported in all email clients. It also adds some weight to your email over what we’ve shown above.
First Create two new activities
Example PowerShell Code for SMTP PS-SMTP-source.zip
Here’s what you get for all your effort in this scenario.
Note: Due to security in Outlook, you’ll need to open this email in the browser to see the graphics by opening the email and going to “Actions/View in Browser” from the toolbar. Result below
To sum all of this up. The Exchange IP does a nice job putting the HTML directly inline within an email message. Using links to internal accessible locations will also allow you to provide graphics directly in your email messages, keep the size down, and provide some level of internal security (if necessary). You can leverage the SMTP option in PowerShell to send a message in that manner and add base64 images embedded directly within the email message. Limitation is that you need to open these in the browser to see them. I’m sure there are other ways to do this. Got some ideas and want to comment – please do and I’ll do my best to incorporate them in this blog post if they make sense.
Till next time, Happy Automating!