Last active
January 3, 2024 13:52
-
-
Save jbennett/c67d06a6a37cebeec067c0ab7605136d to your computer and use it in GitHub Desktop.
introducing noticed-web_push
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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