Another way is to use the ns-do-applescript elisp function:
(ns-do-applescript "display notification \"hello world\"")
(ns-do-applescript "display notification \"hello world\" with title \"some title\"")
to run AppleScript from Emacs.
More info on what commands are available in AppleScript:
Thanks to jbornhold answer in this reddit discussion, I was able to enable notifications for erc nick mentions.
Here's how you can do it:-
install terminal notifier with brew install terminal-notifier
install erc-terminal-notifier.el and add (require 'erc-terminal-notifier) in your .emacs
You might want to enable -reply option in erc-terminal-notifier.el ...