Email Notifications logo

Email Notifications

Organization
serac-labs
email-notifications

Create ServiceNow sysevent_email_action notifications — templates with substitution variables, mail scripts for dynamic content/recipients/attachments, custom events, weights, and digest configuration.

Overview

Publisherserac-labs
Repositoryserac
Skill nameemail-notifications
Stars
78
Forks
26
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by serac-labs on GitHub. Read the source before you install it.

Installation

Install the Email Notifications AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/serac-labs/serac.git /tmp/serac
mkdir -p .claude/skills
cp -r /tmp/serac/packages/skills/email-notifications .claude/skills/email-notifications
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Email Notifications in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Email Notifications on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Email Notifications is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Email Notifications for ServiceNow

ServiceNow notifications are triggered by events and send emails, SMS, or other alerts to users.

Notification Components

ComponentTablePurpose
Notificationsysevent_email_actionMain notification record
Email Templatesysevent_email_templateReusable email layouts
EventsyseventTriggers notifications
Event Registrationsysevent_registerDefines custom events
Email Scriptsys_script_emailDynamic content scripts

Creating Notifications

Basic Notification Structure

Notification: Incident Assigned
├── When to send
│   ├── Table: incident
│   ├── When: Record inserted or updated
│   └── Conditions: assigned_to changes AND is not empty
├── Who will receive
│   ├── Users: ${assigned_to}
│   └── Groups: (optional)
├── What it will contain
│   ├── Subject: Incident ${number} assigned to you
│   ├── Message: HTML body with ${field} references
│   └── Email Template: (optional)
└── Advanced
    ├── Weight: 0 (priority)
    └── Send to event creator: false

Notification Conditions

javascript
// Simple field conditions
assigned_to CHANGES
priority = 1
state = 6  // Resolved

// Script condition (ES5 only!)
// Returns true to send, false to skip
(function() {
    // Only notify for VIP callers
    var caller = current.caller_id.getRefRecord();
    return caller.vip == true;
})()

// Advanced condition with multiple checks
(function() {
    // Don't notify on bulk updates
    if (current.sys_mod_count > 100) return false;

    // Only for production CIs
    var ci = current.cmdb_ci.getRefRecord();
    return ci.used_for == 'Production';
})()

Email Templates

Template Variables

html
<!-- Field references -->
${number}
<!-- Direct field value -->
${caller_id.name}
<!-- Dot-walked reference -->
${opened_at.display_value}
<!-- Display value -->

<!-- Special variables -->
${URI}
<!-- Link to record -->
${URI_REF}
<!-- Reference link -->
${mail_script:script_name}
<!-- Include email script -->

<!-- Conditional content -->
${mailto:assigned_to}
<!-- Mailto link -->

Template Example

html
<html>
  <body style="font-family: Arial, sans-serif;">
    <h2>Incident ${number} - ${short_description}</h2>

    <table border="0" cellpadding="5">
      <tr>
        <td><strong>Priority:</strong></td>
        <td>${priority}</td>
      </tr>
      <tr>
        <td><strong>Caller:</strong></td>
        <td>${caller_id.name}</td>
      </tr>
      <tr>
        <td><strong>Assigned to:</strong></td>
        <td>${assigned_to.name}</td>
      </tr>
      <tr>
        <td><strong>Description:</strong></td>
        <td>${description}</td>
      </tr>
    </table>

    <p>
      <a href="${URI}">View Incident</a>
    </p>

    ${mail_script:incident_history}
  </body>
</html>

Email Scripts

Basic Email Script

javascript
// Email Script: incident_history
// Table: incident
// Script (ES5 only!):

;(function runMailScript(current, template, email, email_action, event) {
  // Build activity history
  var html = "<h3>Recent Activity</h3><ul>"

  var history = new GlideRecord("sys_journal_field")
  history.addQuery("element_id", current.sys_id)
  history.addQuery("name", "incident")
  history.orderByDesc("sys_created_on")
  history.setLimit(5)
  history.query()

  while (history.next()) {
    html += "<li><strong>" + history.sys_created_on.getDisplayValue() + "</strong>: "
    html += history.value.substring(0, 200) + "</li>"
  }
  html += "</ul>"

  template.print(html)
})(current, template, email, email_action, event)

Email Script with Attachments

javascript
// Add attachments from the record to the email
;(function runMailScript(current, template, email, email_action, event) {
  var gr = new GlideRecord("sys_attachment")
  gr.addQuery("table_sys_id", current.sys_id)
  gr.addQuery("table_name", "incident")
  gr.query()

  while (gr.next()) {
    email.addAttachment(gr)
  }
})(current, template, email, email_action, event)

Dynamic Recipients

javascript
// Email Script to add CC recipients dynamically
;(function runMailScript(current, template, email, email_action, event) {
  // Add all group members as CC
  var group = current.assignment_group
  if (!group.nil()) {
    var members = new GlideRecord("sys_user_grmember")
    members.addQuery("group", group)
    members.query()

    while (members.next()) {
      var user = members.user.getRefRecord()
      if (user.email) {
        email.addAddress("cc", user.email, user.name)
      }
    }
  }
})(current, template, email, email_action, event)

Custom Events

Registering a Custom Event

javascript
// Event Registration
// Name: x_myapp.incident.escalated
// Table: incident
// Description: Fired when incident is escalated to management
// Fired by: Business Rule

// In Business Rule (ES5 only!)
;(function executeRule(current, previous) {
  // Check if escalation occurred
  if (current.escalation > previous.escalation) {
    // Fire custom event
    gs.eventQueue(
      "x_myapp.incident.escalated",
      current,
      current.escalation.getDisplayValue(), // parm1
      current.assigned_to.name, // parm2
    )
  }
})(current, previous)

Notification on Custom Event

Notification: Escalation Alert
├── When to send
│   ├── Send when: Event is fired
│   └── Event name: x_myapp.incident.escalated
├── Who will receive
│   └── Users/Groups: Escalation Managers
└── What it will contain
    ├── Subject: Escalation: ${number} - ${event.parm1}
    └── Message: Incident escalated. Assigned to: ${event.parm2}

Recipient Types

Who Will Receive

TypeDescriptionExample
UsersSpecific users${assigned_to}, ${caller_id}
GroupsUser groupsService Desk, CAB
Group ManagersGroup manager field${assignment_group.manager}
Event Parm 1/2From event parameters${event.parm1}
Additional RecipientsEmail addressesExternal emails

Recipient Script

javascript
// Recipient Script (ES5 only!)
// Returns comma-separated list of emails or sys_ids

;(function getRecipients(current, event) {
  var recipients = []

  // Add the caller
  if (!current.caller_id.nil()) {
    recipients.push(current.caller_id.email.toString())
  }

  // Add VIP's manager
  var caller = current.caller_id.getRefRecord()
  if (caller.vip == true && !caller.manager.nil()) {
    recipients.push(caller.manager.email.toString())
  }

  return recipients.join(",")
})(current, event)

Notification Weight

Priority system for multiple matching notifications:

WeightUse Case
0Default priority
1-99Higher priority (lower weight = higher priority)
-1 to -99Lower priority
100+Rarely used
javascript
// Only highest weight notification sends if "Exclude subscribers" checked
// Weight 0 notification beats Weight 10 notification

Digest Notifications

Configuring Digest

Notification: Daily Incident Summary
├── Digest: Checked
├── Digest Interval: Daily
├── Digest Time: 08:00
└── Content: Summary of all incidents

Digest Email Script

javascript
// Summarize digest records
;(function runMailScript(current, template, email, email_action, event) {
  var count = 0
  var html = '<table border="1" cellpadding="5">'
  html += "<tr><th>Number</th><th>Description</th><th>Priority</th></tr>"

  // 'current' is a GlideRecord with all digest records
  while (current.next()) {
    count++
    html += "<tr>"
    html += "<td>" + current.number + "</td>"
    html += "<td>" + current.short_description + "</td>"
    html += "<td>" + current.priority.getDisplayValue() + "</td>"
    html += "</tr>"
  }
  html += "</table>"
  html += "<p>Total: " + count + " incidents</p>"

  template.print(html)
})(current, template, email, email_action, event)

Outbound Email Configuration

Email Properties

javascript
// System Properties for email
glide.email.smtp.active // Enable/disable outbound email
glide.email.smtp.host // SMTP server
glide.email.smtp.port // SMTP port (usually 25 or 587)
glide.email.default.sender // Default from address
glide.email.test.user // Test recipient (all emails go here)

Testing Notifications

javascript
// Background Script to test notification (ES5 only!)
var gr = new GlideRecord("incident")
gr.get("sys_id_here")

// Fire event to trigger notification
gs.eventQueue("incident.assigned", gr, gr.assigned_to.getDisplayValue(), gs.getUserDisplayName())

gs.info("Event queued for incident: " + gr.number)

Best Practices

  1. Use Templates - Reuse layouts across notifications
  2. Test Thoroughly - Use test user property during development
  3. Consider Digests - For high-volume notifications
  4. Weight Carefully - Prevent duplicate emails
  5. ES5 Only - All scripts must be ES5 compliant
  6. Limit Recipients - Don't spam large groups
  7. Include Context - Provide enough info to act without login
  8. Mobile-Friendly - Keep HTML simple for mobile clients

Common Issues

IssueCauseSolution
Email not sentEvent not firedCheck business rule fires event
Wrong recipientsScript errorDebug recipient script
Missing contentTemplate variable wrongCheck field names
Duplicate emailsMultiple notificationsCheck weights and conditions
Delayed emailsEmail job scheduleCheck sysauto_script

Frequently asked questions

What does the Email Notifications AI skill do?

Create ServiceNow sysevent_email_action notifications — templates with substitution variables, mail scripts for dynamic content/recipients/attachments, custom events, weights, and digest configuration.

Why use Email Notifications on TypingMind?

Because you install it once and use it with any model. Email Notifications is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Email Notifications in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/serac-labs/serac/tree/main/packages/skills/email-notifications. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Email Notifications?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Email Notifications?

As many as you like. As long as a model supports skills, you can use Email Notifications with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Email Notifications AI skill free?

Yes. It is published on GitHub by serac-labs under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇