Skip to main content

Scheduled Banner Updates for Autotask Email Notifications

This tutorial walks through building a scheduled task that automatically updates a banner message on every Autotask Account. When combined with Autotask notification templates that reference the banner field, this lets you display time-sensitive messages (holiday hours, maintenance windows, announcements) in every outbound email from Autotask without manually editing templates.


Overview

The workflow uses three components:

  1. A User-Defined Field (UDF) on the Account entity in Autotask that holds the current banner text
  2. Autotask notification templates that reference the UDF, so the banner appears in every outbound email
  3. A scheduled task in Email2AT that runs daily, determines the correct banner for today's date, and updates the UDF on every Account

Related pages:


Prerequisites

Create the UDF in Autotask

  1. In Autotask, navigate to Admin > Features & Settings > User-Defined Fields
  2. Create a new UDF on the Account (or Company) entity
  3. Name it something like Email Notification Banner Text
  4. Set the type to Text or Long Text
  5. Make sure the UDF is visible on the appropriate Account categories

Insert the UDF in Autotask Notification Templates

  1. Navigate to Admin > Automation > Notification Templates
  2. Edit the templates for ticket notifications (creation, update, etc.)
  3. Insert the Account UDF variable where you want the banner to appear (typically at the top or bottom of the email body)
  4. Save the templates

Now every outbound email from Autotask will include whatever text is stored in that UDF on the ticket's Account.


Building the Scheduled Task

Create the Scheduled Task

  1. In Email2AT, navigate to Scheduled Tasks
  2. Click Add New Scheduled Task
  3. Name it Update Email Banner
  4. Set the cron schedule to run daily. For example: 7 0 * * * (every day at 00:07 UTC)
Choosing a timezone

The cron schedule runs in UTC by default. If your team operates in a different timezone, offset the cron hour accordingly. For example, to run at midnight US Eastern time, use 7 5 * * * (5:07 AM UTC). The offset matters because the scheduled task determines "today's date" at the moment it runs, which affects which banner message is selected.

Action 1: Define the Banner Messages

Use a Render Text and Store as Variable action to define your date-to-message map.

  1. Click Add New Action, select Render Text and Store as Variable, click OK
  2. Name the step Define Banner Messages
  3. In the text field, enter your banner definitions, one per line, in the format date|message:
2026-01-01|Happy New Year! Our offices are closed today. Normal hours resume January 2nd.
2026-05-25|Memorial Day: Our offices are closed. Normal hours resume May 26th.
2026-07-04|Independence Day: Our offices are closed. Normal hours resume July 7th.
2026-12-24|Holiday hours: Our offices close at noon today and reopen December 26th.
2026-12-25|Merry Christmas! Our offices are closed today and reopen December 26th.
  1. In Store results in variable, enter banner_definitions
Managing definitions

For easier management, you can store the definition list in an Autotask Account note or a dedicated UDF instead of hard-coding it in the action. Query for the note in a previous step and use its contents as the definition list.

Action 2: Extract Today's Banner

Use a Perform a Regular Expression Match action with "Return all matches" enabled to find the banner for today's date.

  1. Click Add New Action, select Perform a Regular Expression Match, click OK
  2. Name the step Find Today's Banner
  3. Set Pattern to:
/^{{date format="Y-m-d"}}\|(.+)$/m

This pattern looks for a line that starts with today's date followed by a pipe and captures the message text.

  1. Set Input to {{custom.banner_definitions}}
  2. Enable Return all matches
  3. In Store results in variable, enter banner_match

Action 3: Set the Banner Text

Use a Render Text and Store as Variable action to set the banner text. If no match was found for today's date, use a default (empty or a standard message).

  1. Click Add New Action, select Render Text and Store as Variable, click OK
  2. Name the step Set Banner Text
  3. In the text field, enter:
{{#if banner_match.[0].[1]}}{{custom.banner_match.[0].[1]}}{{else}}{{/if}}

This uses the first match's capture group if one exists, or renders empty if no match was found.

  1. In Store results in variable, enter banner_text

Action 4: Query All Accounts

  1. Click Add New Action, select API: Query for Object(s), click OK
  2. Name the step Get All Accounts
  3. Set Entity Type to Account
  4. Add query conditions:
    • Active equals 1 (or true)
  5. In Store results in variable, enter accounts

Action 5: Iterate and Update Each Account

  1. Click Add New Action, select Iterate Through Array, click OK
  2. Name the step Update Banner on Each Account
  3. Set Field to Iterate to custom.accounts
  4. Set Value Variable Name to account

Nested action: Update the Account UDF

  1. Inside the iteration, click Add New Action, select API: Update an Object, click OK
  2. Name the step Set Banner UDF
  3. Set Entity Type to Account
  4. Set Only perform this action if: the account's current UDF value differs from the new banner text (this avoids unnecessary API calls). If you cannot easily compare, skip this condition and update all accounts unconditionally.
  5. Configure fields:
    • ID: {{custom.account.id}} (unlock the field)
    • UDF: Email Notification Banner Text: {{custom.banner_text}} (unlock the field)

Activating the Schedule

  1. Test the scheduled task manually by clicking the Run button
  2. Open the processing log in History and verify:
    • The correct banner was selected for today's date (or empty if no match)
    • Accounts were queried
    • Each account was updated with the new banner text
  3. Open a test Account in Autotask and confirm the UDF was updated
  4. Send a test notification from Autotask and verify the banner appears in the email
  5. Once confirmed, enable the schedule

Key Takeaways

  • UDFs bridge Email2AT and Autotask templates: the scheduled task writes to the UDF, and the Autotask notification template reads from it
  • Date matching drives the banner: define date/message pairs and the regex selects today's match automatically
  • Empty banner clears the message: when no match is found, the UDF is set to empty, so no banner appears in emails
  • Timezone matters: the cron schedule and {{date}} helper both use UTC by default; offset the schedule if your business operates in a different timezone
  • Update only when changed: if possible, compare the current UDF value to the new one to avoid unnecessary API calls