Token导航 LogoToken导航TokenDH.com
前端设计只读github未标认证来源可访问clear审计通过

email-notifications电子邮件通知

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

1,584

周安装

66

GitHub Stars

63

下载量

528
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:email-notifications(电子邮件通知)
来源仓库:https://github.com/groeimetai/snow-flow
仓库路径:skills/email-notifications
安装命令:
npx skills add https://github.com/groeimetai/snow-flow --skill email-notifications
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/groeimetai/snow-flow --skill email-notifications

简介

email-notifications 解析 ServiceNow 通知机制,指导创建事件驱动的邮件提醒。

  • 适用于配置工单分配、状态变更、审批请求等场景的自动邮件触发逻辑。
  • 涵盖 sysevent_email_action、sysevent_email_template 等组件的使用方法。
  • 需熟悉 ServiceNow 平台架构并在沙箱环境中先行测试验证。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

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

// 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

<!-- 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>
  <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

// 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

// 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

// 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

// 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

// 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
// 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

// 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

// 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

// 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

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

29.08%
按下载量换算154

Antigravity

25.9%
按下载量换算137

Gemini CLI

19.06%
按下载量换算101

windsurf

12.38%
按下载量换算65

Codex

8.51%
按下载量换算45

OpenCode

3.58%
按下载量换算19

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills