Skip to content

Notifications

Send messages via Slack, Discord, Teams, Telegram, email, SMS, and WhatsApp.

9 modules

ModuleDescription
Twilio 撥打電話透過 Twilio 撥打語音電話
Twilio 發送簡訊透過 Twilio 發送簡訊
傳送 Discord 訊息透過 webhook 傳送訊息到 Discord
傳送電子郵件透過 SMTP 傳送電子郵件
傳送 Slack 訊息透過 webhook 傳送訊息到 Slack
發送 Teams 訊息透過傳入的 webhook 發送訊息到 Microsoft Teams
傳送 Telegram 訊息透過 Telegram Bot API 傳送訊息
發送 WhatsApp 訊息透過 WhatsApp Business API(Meta Cloud API)發送訊息
發送通知發送通知到 Telegram、Discord、Slack、LINE 或任何 webhook URL

Modules

Twilio 撥打電話

communication.twilio.make_call

透過 Twilio 撥打語音電話

Parameters:

NameTypeRequiredDefaultDescription
account_sidstringNo-Twilio 帳戶 SID(或使用 TWILIO_ACCOUNT_SID 環境變數)
auth_tokenstringNo-Twilio 認證權杖(或使用 TWILIO_AUTH_TOKEN 環境變數)
from_numberstringYes-Twilio 認證權杖(或使用 TWILIO_AUTH_TOKEN 環境變數)
to_numberstringYes-Twilio 電話號碼
twiml_urlstringYes-收話方電話號碼

Output:

FieldTypeDescription
sidstringThe sid
statusstringOperation status (success/error)
tostringThe to
fromstringThe from

Example: Make automated call

yaml
from_number: +1234567890
to_number: +0987654321
twiml_url: https://example.com/voice.xml

Twilio 發送簡訊

communication.twilio.send_sms

透過 Twilio 發送簡訊

Parameters:

NameTypeRequiredDefaultDescription
account_sidstringNo-Twilio 帳戶 SID(或使用 TWILIO_ACCOUNT_SID 環境變數)
auth_tokenstringNo-Twilio 認證權杖(或使用 TWILIO_AUTH_TOKEN 環境變數)
from_numberstringYes-Twilio 電話號碼(例如 +1234567890)
to_numberstringYes-Twilio 電話號碼(例如 +1234567890)
messagestringYes-收話方電話號碼(例如 +1234567890)

Output:

FieldTypeDescription
sidstring簡訊內容
statusstring簡訊內容
tostringSID
fromstring操作狀態(成功/錯誤)

Example: Send notification SMS

yaml
from_number: +1234567890
to_number: +0987654321
message: Your order has been shipped!

Example: Send verification code

yaml
from_number: +1234567890
to_number: +0987654321
message: Your verification code is: 123456

傳送 Discord 訊息

notification.discord.send_message

透過 webhook 傳送訊息到 Discord

Parameters:

NameTypeRequiredDefaultDescription
webhook_urlstringNo-Discord webhook 網址(來自 env.DISCORD_WEBHOOK_URL 或直接輸入)
contentstringYes-要傳送的訊息
usernamestringNo-覆蓋機器人使用者名稱(選填)
avatar_urlstringNo-機器人頭像圖片網址(選填)

Output:

FieldTypeDescription
statusstring操作狀態
sentboolean是否成功傳送
messagestring傳送的訊息

Example: Example

yaml
content: Workflow completed successfully!

傳送電子郵件

notification.email.send

透過 SMTP 傳送電子郵件

Parameters:

NameTypeRequiredDefaultDescription
smtp_serverstringYes-SMTP 伺服器主機名稱(例如 smtp.gmail.com)
smtp_portnumberNo587SMTP 連接埠(TLS 為 587,SSL 為 465)
usernamestringYes-SMTP 使用者名稱
passwordstringYes-SMTP 密碼(請使用環境變數!)
from_emailstringYes-寄件者電子郵件地址
to_emailstringYes-收件者電子郵件地址
subjectstringYes-郵件主旨
bodytextYes-郵件內容(支援 HTML)
htmlbooleanNoFalse以 HTML 格式傳送內容

Output:

FieldTypeDescription
statusstring操作狀態
sentboolean是否成功傳送
messagestring結果訊息

Example: Example

yaml
smtp_server: smtp.gmail.com
smtp_port: 587
from_email: bot@example.com
to_email: user@example.com
subject: Workflow Complete
body: Your automation workflow has finished successfully.

傳送 Slack 訊息

notification.slack.send_message

透過 webhook 傳送訊息到 Slack

Parameters:

NameTypeRequiredDefaultDescription
webhook_urlstringNo-Slack webhook 網址(來自 env.SLACK_WEBHOOK_URL 或直接輸入)
textstringYes-要傳送的訊息
channelstringNo-覆蓋預設頻道(選填)
usernamestringNo-覆蓋機器人使用者名稱(選填)
icon_emojistringNo-機器人圖示 emoji(選填)

Output:

FieldTypeDescription
statusstring操作狀態
sentboolean是否成功傳送
messagestring傳送的訊息

Example: Example

yaml
text: Workflow completed successfully!

Example: Example

yaml
text: Alert: New user registered!
channel: #alerts
username: Alert Bot
icon_emoji: :warning:

發送 Teams 訊息

notification.teams.send_message

透過傳入的 webhook 發送訊息到 Microsoft Teams

Parameters:

NameTypeRequiredDefaultDescription
webhook_urlstringYes-Microsoft Teams 傳入 webhook URL
messagetextYes-要發送的訊息文字
titlestringNo-訊息卡片標題(選填)
colorstringNo-主題顏色的十六進位碼(選填)
sectionsarrayNo-額外的 MessageCard 區段(選填)

Output:

FieldTypeDescription
okboolean操作是否成功
dataobject包含狀態和 webhook_url 的回應資料

Example: Example

yaml
webhook_url: https://outlook.office.com/webhook/...
message: Deployment completed successfully!
title: Deploy Status
color: #00FF00

傳送 Telegram 訊息

notification.telegram.send_message

透過 Telegram Bot API 傳送訊息

Parameters:

NameTypeRequiredDefaultDescription
bot_tokenstringNo-Telegram 機器人 Token(來自 env.TELEGRAM_BOT_TOKEN 或直接輸入)
chat_idstringYes-Telegram 聊天室 ID 或頻道使用者名稱
textstringYes-要傳送的訊息
parse_modeselect (Markdown, HTML, None)NoMarkdown訊息格式模式

Output:

FieldTypeDescription
statusstring操作狀態
sentboolean是否成功傳送
message_idnumber訊息 ID
messagestring傳送的訊息

Example: Example

yaml
chat_id: @mychannel
text: Workflow completed!

Example: Example

yaml
chat_id: 123456789
text: *Bold* _italic_ `code`
parse_mode: Markdown

發送 WhatsApp 訊息

notification.whatsapp.send_message

透過 WhatsApp Business API(Meta Cloud API)發送訊息

Parameters:

NameTypeRequiredDefaultDescription
phone_number_idstringYes-WhatsApp Business 發送者的電話號碼 ID
tostringYes-包含國碼的收件人電話號碼
messagetextYes-要發送的訊息文字
access_tokenpasswordYes-WhatsApp Business API 的 Meta 存取權杖
message_typeselect (text, template)Notext要發送的訊息類型
template_namestringNo-WhatsApp 訊息範本名稱(若 message_type 是範本則必填)
template_languagestringNoen範本語言代碼

Output:

FieldTypeDescription
okboolean操作是否成功
dataobject包含狀態、message_id 和 to 的回應資料

Example: Example

yaml
phone_number_id: 1234567890
to: +1987654321
message: Your order has been shipped!
access_token: EAAx...

Example: Example

yaml
phone_number_id: 1234567890
to: +1987654321
message: 
access_token: EAAx...
message_type: template
template_name: hello_world
template_language: en

發送通知

notify.send

發送通知到 Telegram、Discord、Slack、LINE 或任何 webhook URL

Parameters:

NameTypeRequiredDefaultDescription
urlstringYes-Webhook URL(Telegram、Discord、Slack 或自訂)
messagestringYes-通知訊息內容
titlestringNo-通知訊息內容
chat_idstringNo-選填標題(適用於 Discord、Slack、Teams)

Output:

FieldTypeDescription
okbooleanTelegram 聊天 ID(Telegram 必需)
platformstring通知是否成功發送
status_codenumber通知是否成功發送
responseobject偵測到的平台(telegram、discord、slack 等)

Example: Send Telegram notification

yaml
url: https://api.telegram.org/bot<TOKEN>/sendMessage
message: BTC: $42,350 (+1.7%)
chat_id: 123456789

Example: Send Discord notification

yaml
url: https://discord.com/api/webhooks/xxx/yyy
message: Price alert triggered!
title: Crypto Alert

Example: Send Slack notification

yaml
url: https://hooks.slack.com/services/xxx/yyy/zzz
message: Deployment completed successfully

Released under the Apache 2.0 License.