Skip to content

Instantly share code, notes, and snippets.

@jbennett
Last active January 3, 2024 13:52
Show Gist options
  • Save jbennett/c67d06a6a37cebeec067c0ab7605136d to your computer and use it in GitHub Desktop.
Save jbennett/c67d06a6a37cebeec067c0ab7605136d to your computer and use it in GitHub Desktop.
introducing noticed-web_push
class NewPostNotification < Noticed::Base
# ... other deliver methods
deliver_by :web_push, data_method: :web_push_data
def web_push_data
{
title: "New post: #{post.title}",
body: post.content.truncate(40),
url: post_url(post),
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment