Email Jobs: Setting Job Properties Through Scripts

Attributes defined for an object affect how the object is processed. Script statements allow you to dynamically change those object attributes and assign new values when the task is generated. The new values are only valid for the current generation and are not permanently stored in the object.

You can define the values of any of the settings of all Mail Jobs using scripts. You do this by using :PUT_ATT commands on the Pre-Process object definition page.

For more information, see the Automic Automation product documentation:

This page includes the following:

Email Jobs: Mail Job Attributes

The attributes available for Mail Jobs are the following:

  • >connection

    Changes the value of the Email Connection object definition

    Data type: string

    Value for PUT_ATT: "<Existing Connection Object name>"

  • function

    Changes the value of the Function definition

    Data type: string

    Value for PUT_ATT: "<DOWNLOAD/DELETE/COPY>"

  • mailFolder

    Changes the value of the Mailbox Folder definition

    Data type: string

    Value for PUT_ATT: "<Existing Mailbox Folder>"

  • destFolder

    Changes the value of the Destination Folder definition

    Data type: string

    Value for PUT_ATT: "<Existing Mailbox Folder>"

  • deleteSource

    Changes the value of the Delete Source Mail definition

    Data type: boolean

    Value for PUT_ATT: "<Y/N>"

  • directory

    Data type: string

    Value for PUT_ATT: "<Existing agent directory>"

  • subDirType

    Downloads the emails and their attachments either to separate folders, or directly under the workspace directory.

    Data type: string

    Value for PUT_ATT: "<RUNID/NONE>"

  • saveAttachment

    Changes the value of the Save Attachment definition

    Data type: boolean

    Valid values for PUT_ATT: "<Y/N>"

  • returnCode

    Changes the value of the Return code for no email definition

    Data type: integer

    Value for PUT_ATT: "<Numeric value (0-n)>"

  • filterStatus

    Changes the value of the Filter "Status" definition

    Data type: string

    Value for PUT_ATT: "<ALL/READ/UNREAD>"

  • filterSentFrom

    Changes the value of the Filter "Sent From" definition

    Data type: string

    Value for PUT_ATT: "<Regular expression>"

  • filterSentTo

    Changes the value of the Filter "Sent To" definition

    Data type: string

    Valid values for PUT_ATT: "<Regular expression>"

  • filterSentToCC
    Changes the value of the Filter "Sent To CC" definition

    Data type: string

    Value for PUT_ATT: "<Regular expression>"

  • filterSubject

    Changes the value of the Filter "Subject" definition

    Data type: string

    Value for PUT_ATT: "<Regular expression>"

  • filterOlderThan

    Changes the value of the Filter "Older Than" definition

    Data type: integer

    Value for PUT_ATT: "<Number of days (1-n)>"

Examples

The following example dynamically changes the value of the Mailbox Folder field to INPUT using the :PUT_ATT script statement. Save and execute the following script on the Pre-Process page of the job:

:PUT_ATT mailFolder = INBOX

As the above example changes the value of a text field, you can achieve the same result using the :SET script statement. Define the &inbox# script variable in the Mailbox Folder:

Script variable definition in Mailbox Folder

Now use the :SET script on the Pre-Process page of the job, and remember to include your value definition in brackets.

:SET &inbox# = "INBOX"

See also: