So I have been having fun with Automator lately and started to like it very much. I think overall it works pretty well. In my previous post, I described a way of telling your chat application to send a message to a chatroom automatically everyday at a certain hour. In this post, we are going to do a similar thing but this time will use Automator’s workflow power to send an email message everyday at a certain time too. The body of the email message is going to be read from a text file and the contents will be delivered to the recipients that are defined in the workflow.
Since this workflow is going to be also an iCal alarm, you will need to click Calendar Alarm as well:
Before we go on with the tutorial, let’s define what our workflow should consist of:
1 – Get to the file that consists of your email body.
2 – Open the file that consists of your email body.
3 – Get the contents of the document.
4 – Compose a new Message via Workflow
5 – Finally send your email message
1 – Get to the file that consists of your email body
After clicking iCal alarm, you will see the actions menu on the left and your workflow area on the right. To “get to the fle that consist of your email body”, you will first click “Files and Folders” on the left, then drag “Get specified Finder Items” to the workflow area as shown below:
Now that your first Workflow item is added on the right side, you can click “Add” button to get to the file.
2 – Open the file that consists of your email body
Now that you have added which file to get to, you need to open it:
You will need to choose a text editor to open the email body, so I chose TextEdit to do so above.
3 – Get the Contents of the Document
Now that we open the file, you need to tell Automator to fetch the contents of this file. You can do this by selecting “Text” in the actions menu and drag “Get Contents of TextEdit Document”:
We need to tie this workflow item into composing mail, which is the next step
4 – Compose a New Message Via Workflow
This part is the heart of the operation and it is very self explanatory:
Notice several things here:
- In your New Mail Message make sure to use To: for individuals and CC: section for individuals and mail groups.
- Set your Subject Line to whatever you wish
- Do not enter the Message body, since we are reading it from a file. Leave it empty
5 – Finally send your message
This will require an action workflow item from the Mail menu, called “Send outgoing messages”. If you do not add this, your message will not be sent and it will remain open. So the image below shows the last piece:
When you are finished with this, click “File” and “Save”. You can do a test run of your workflow by just clicking “Run” on the right hand side. When you click save and give it a name, Automator will open iCal automatically and let you set your date and time you want to send the message. If you run into issues, take a look at my previous post about this.