@suphark/notify 0.10.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -503,6 +503,7 @@ Pi Notify มี contract test (`apps/notify/src/test/contract/`) เก็บ b
503
503
 
504
504
  ## Changelog
505
505
 
506
+ - 0.10.1 — ข้อความสำรองของเทมเพลต `auth.*` ใช้ชื่อผู้ส่ง (`from` / `MAIL_FROM`) เป็นชื่อแอปในหัวเรื่องเมื่อแอปไม่ได้ส่ง `appName` (เดิมหัวเรื่องไม่มีชื่อแอป)
506
507
  - 0.10.0 — **อีเมลล็อกอินมาตรฐาน + ข้อความสำรอง** (เพิ่มอย่างเดียว; ต้องใช้ Pi Notify 2026-11-11+)
507
508
  - เทมเพลตมาตรฐาน `auth.magic-link` / `auth.reset-password` / `auth.verify-email` ใช้ได้ทุกแอปโดยไม่ต้องสร้าง (สร้างชื่อเดียวกันเพื่อปรับ)
508
509
  - ติดต่อ hub ไม่ได้ → ส่งข้อความพื้นฐานผ่าน provider ในเครื่อง (`SendResult.fallback`, event `"fallback"`) · `Message.fallback` สำหรับเทมเพลตของแอปเอง
@@ -921,7 +921,17 @@ function createMailer(options = {}) {
921
921
  }
922
922
  async function send(message) {
923
923
  if (!message?.template) return sendVia(message, "all");
924
- const fallback = message.fallback ?? builtinFallback(message.template, message.data);
924
+ const fromName = (() => {
925
+ try {
926
+ return (message.from !== void 0 ? parseAddress(message.from) : defaultFrom)?.name;
927
+ } catch {
928
+ return void 0;
929
+ }
930
+ })();
931
+ const fallback = message.fallback ?? builtinFallback(message.template, {
932
+ ...fromName ? { appName: fromName } : {},
933
+ ...message.data
934
+ });
925
935
  const hasHub = entries.some((e) => e.provider.type === "hub");
926
936
  const hasLocal = entries.some((e) => e.provider.type !== "hub" && !e.disabled);
927
937
  const asFallback = (fb) => ({
package/dist/index.js CHANGED
@@ -41,7 +41,7 @@ import {
41
41
  sendMail,
42
42
  sendMailSafe,
43
43
  toEmails
44
- } from "./chunk-CWZP54ZN.js";
44
+ } from "./chunk-JN7P2CVF.js";
45
45
  import {
46
46
  BUILTIN_TEMPLATE_KEYS,
47
47
  TemplateError,
package/dist/next.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  notifySafe,
3
3
  notifyTopicSafe,
4
4
  sendMailSafe
5
- } from "./chunk-CWZP54ZN.js";
5
+ } from "./chunk-JN7P2CVF.js";
6
6
  import "./chunk-NNMV7FZ3.js";
7
7
 
8
8
  // src/next.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suphark/notify",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "ส่งอีเมล + แจ้งเตือน Telegram ผ่าน Pi Notify hub (notify.suphark.com) หรือส่งอีเมลตรงไป Resend/SMTP/Zoho/ZeptoMail ใน API เดียว พร้อม failover อัตโนมัติ",