Thanks to our user @simendsjo who posted on GitHub!
(define-command toggle-read/unread ()
;; TODO: Add an arrows package and use that
(let ((html (document-model (current-buffer))))
(alexandria:when-let (button (find-if (lambda (n) (equal "Read / Unread" (plump:attribute n "aria-label")))
(plump:get-elements-by-tag-name html "button")))
(nyxt/dom:click-element button))))
(define-mode outlook-mode ()
((keyscheme-map (define-keyscheme-map "outlook-mode" ()
nyxt/keyscheme:vi-normal (list "C-c C-r" 'toggle-read/unread)
nyxt/keyscheme:vi-insert (list "C-c C-r" 'toggle-read/unread)))))
(define-auto-rule '(match-host "outlook.office.com")
:included '(outlook-mode))