Monday, July 23, 2012

Using Dispatch to send email by card variable


I want to set users for specific tasks and then have enterprise send emails to those people without doing it through workflows (which I've done in the past). In this example it's a button on the data card, but I plan to send the emails once the files pass through a transition.

I'm not a programmer, I don't know how to use the API, but this is what I came up with. I'm looking for feedback and maybe some ways to improve upon this.

  • First, the data card needs to have the variables for said tasks, I used the user login name for the list, which matches our windows user names, and also outlook.











  • Second, create 2 files in the vault
    • File #1: email_template.txt
      • This file will be used by dispatch to output a command line prompt that includes variable values.
      • "C:\Program Files (x86)\Microsoft Office\OFFICE14\OUTLOOK.EXE" /c ipm.note /m "%ECO Val owner DFMEA%;%ECO Val owner Cust App%;%ECO Val owner DVPR%;%ECO Val owner CWO%;%ECO Val owner Risk%;%ECO Val owner Gage%;%ECO Val owner Times%?do=newpm&u=&subject=You have open Tasks in ECRxxxx"
      • This looks like a lot but it breaks down like this.....
        • enter the path to your outlook
          • "C:\Program Files (x86)\Microsoft Office\OFFICE14\OUTLOOK.EXE"
        • Add the following arguments:
          • /c ipm.note /m
        • Add the variables (usernames) separated by ; <this becomes TO data>
          • "%ECO Val owner DFMEA%;%ECO Val owner Cust App%;%ECO Val owner DVPR%;%ECO Val owner CWO%;%ECO Val owner Risk%;%ECO Val owner Gage%;%ECO Val owner Times%
        • End with the following:
          • ?do=newpm&u=&subject=You have open Tasks in ECRxxxx"

    • File #2: tasks_email.bat
      • This is the parameter file that Dispatch will Create.
  • Dispatch Setup











~Corey Hinman
CEPA, CSWP

1 comment:

  1. This is a great post - you can expand on this and use PowerShell to send the message automatically without even launching outlook and include the file name and path in the subject and also the body of the email.

    ReplyDelete