Skip to main content
Skip table of contents

Email - Send Message Conditionally

Overview

Send a message to anyone in the world using email, attaching one or more files.

To have Workflows dynamically parse and output the contents of a file, you can include the filename in this format: {{text:file.txt}}

To upload multiple files, use Regex Match Type.

Due to email file size constraints, when the the total file size >10MB, Workflows will automatically zip the files under the name "Archive.zip".

Note: This Task cannot be used to access a local file from your computer.

Recommended Setup:

  1. A Task built with this Template should typically run after a Task that either downloads a file to Workflows or generates a file with code.

Variables

NameReferenceTypeRequiredDefaultOptionsDescription
Sender NameEMAIL_SENDER_NAMEAlphanumericNone-The name you want users to see that the email is from. If left blank, the Sender Address will be used.
ToEMAIL_TOAlphanumericNone-The email(s) that you want to send a message to. Can be comma-separated to include multiple email addresses.
CCEMAIL_CCAlphanumericNone-The email(s) that you want your message to be carbon copied (CCed) to. Can be comma-separated to include multiple email addresses.
BCCEMAIL_BCCAlphanumericNone-The email(s) that you want to be blind carbon copied (BCCed) to. Can be comma-separated to include multiple email addresses. Emails in this field will receive the email, but will not have their email exposed to all other recipients.
SubjectEMAIL_SUBJECTAlphanumericNone-The subject of the email that you want to send.
MessageEMAIL_MESSAGEAlphanumericNone-The body of the email, containing your main message. This field supports plain text as well as HTML. The body of the email, containing your main message. This field supports plain text as well as HTML. To have Workflows dynamically parse and output the contents of a file, you can include the filename in this format: {{text:file.txt}}
Include Workflows Footer?EMAIL_INCLUDE_SHIPYARD_FOOTERBooleanTRUE-Determines if a footer should be sent with the email that links back to the originating Task or Workflow.
Send Messages Only WhenEMAIL_CONDITIONAL_SENDSelectfile_existsFile(s) Exist: file_exists

File(s) Don't Exist: file_dne
Determines what condition needs to be met for a message to send. File(s) Exist - Send the message only if a file can be found using the provided folder/filename.ext combination. File(s) Don't Exist - Send the message only if a file cannot found using the provided folder/filename.ext combination.
File Name Match TypeEMAIL_SOURCE_FILE_NAME_MATCH_TYPESelectexact_matchRegex: regex_match

Exact: exact_match
Determines if the text in "File Name" will look for one file with exact match, or multiple files using regex.
File NameEMAIL_SOURCE_FILE_NAMEAlphanumericNone-Name of the target file on Workflows. Can be regex if "Match Type" is set accordingly
Folder NameEMAIL_SOURCE_FOLDER_NAMEAlphanumericNone-Name of the local folder on Workflows to upload the target file from. If left blank, will look in the home directory.

YAML

Below is the YAML template

YAML

source:
  template: Email - Send Message Conditionally
  inputs:
    EMAIL_SENDER_NAME:
    EMAIL_TO:
    EMAIL_CC:
    EMAIL_BCC:
    EMAIL_SUBJECT:
    EMAIL_MESSAGE:
    EMAIL_INCLUDE_SHIPYARD_FOOTER: 'TRUE'
    EMAIL_CONDITIONAL_SEND: file_exists
    EMAIL_SOURCE_FILE_NAME_MATCH_TYPE: exact_match
    EMAIL_SOURCE_FILE_NAME:
    EMAIL_SOURCE_FOLDER_NAME:
  type: TEMPLATE
guardrails:
  retry_count: 1
  retry_wait: 0h0m0s
  runtime_cutoff: 1h0m0s
  exclude_exit_code_ranges:
    - 102
    - 104
    - 200
    - 201
    - 203

      
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.