You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## What?
This adds one focused extension point: post-render body transformation
with raw-source access. Plugins can now:
- Recolor / bold / italicize matched substrings (`gsub` +
`matcha.style`)
- Remove parts of the body (`gsub` with `""`)
- Parse the raw HTML/plain source and prepend or fully replace the
displayed output
## Why?
Plugin SDK previously had no way to touch displayed email content.
Signed-off-by: drew <[email protected]>
Copy file name to clipboardExpand all lines: docs/docs/Features/Plugins.md
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -315,6 +315,52 @@ end)
315
315
|`cc`| string | Current CC recipient(s) |
316
316
|`bcc`| string | Current BCC recipient(s) |
317
317
318
+
### email_body_render
319
+
320
+
Fired right before an email body is displayed in the email view. Receives `(email, rendered, raw)`:
321
+
322
+
-`email`: same table as `email_viewed`
323
+
-`rendered`: the ANSI-styled display string (post HTML→terminal conversion)
324
+
-`raw`: the original message body (HTML or plain text) — parse this when you need the source instead of the rendered output
325
+
326
+
Return a new string to replace the rendered body, or `nil` to leave it unchanged. You can recolor, bold/italicize, remove parts, or fully replace the displayed body with parsed output.
Caveat: the body string already contains ANSI escape sequences from the HTML→terminal conversion. Patterns that straddle existing escapes will not match. Match plain text spans for predictable behavior.
363
+
318
364
## Marketplace
319
365
320
366
Matcha includes a built-in plugin marketplace with 35+ community plugins. You can browse and install plugins from the terminal or from the [online marketplace](/marketplace).
|`email_body_render`|`(email_table, rendered, raw)` — return a string to replace the rendered body, or `nil` to keep it | About to display an email body. `rendered` is the ANSI-styled display string; `raw` is the original message source (HTML or plain text). Use for recoloring, bold/italic, removing parts, or fully replacing the displayed body with parsed output |
Copy file name to clipboardExpand all lines: plugins/registry.json
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,18 @@
47
47
"description": "Warns before sending an email with an empty body.",
48
48
"file": "empty_body_guard.lua"
49
49
},
50
+
{
51
+
"name": "link_summary",
52
+
"title": "Link Summary",
53
+
"description": "Parses the raw body, extracts every URL, and prepends a numbered link summary to the displayed email. Demo of full body manipulation via the email_body_render hook.",
54
+
"file": "link_summary.lua"
55
+
},
56
+
{
57
+
"name": "github_highlighter",
58
+
"title": "GitHub Highlighter",
59
+
"description": "Highlights every \"GitHub\" mention in displayed email bodies with bold purple text. Demo of the email_body_render hook.",
0 commit comments