email_age.lua

 1-- email_age.lua
 2-- Shows the date of the email you're viewing in the status bar.
 3
 4local matcha = require("matcha")
 5
 6matcha.on("email_viewed", function(email)
 7    -- Show the date portion of the RFC3339 timestamp.
 8    local date = email.date:match("^(%d%d%d%d%-%d%d%-%d%d)")
 9    if date then
10        matcha.set_status("email_view", "Date: " .. date)
11    end
12end)