This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

at main 2.7 kB View raw
1package notella 2 3import "time" 4 5type Event string 6 7const ( 8 EventClearStoredSchedule Event = "clear_stored_schedule" 9 EventShowScheduledJobs Event = "show_scheduled_jobs" 10 EventSaveSchedule Event = "save_schedule" 11 EventRestoreSchedule Event = "restore_schedule" 12 // Like restore_schedule, but also re-schedules events that have send_at in the past 13 EventRestoreScheduleEager Event = "restore_schedule_eager" 14 EventClearSchedule Event = "clear_schedule" 15 EventNewPost Event = "new_post" 16 EventGodchildRequest Event = "godchild_request" 17 EventCustom Event = "custom" 18 EventTest Event = "test" 19 EventGodchildAccepted Event = "godchild_accepted" 20 EventGodchildRejected Event = "godchild_rejected" 21 EventPendingSignup Event = "pending_signup" 22 EventLoginStuck Event = "login_stuck" 23 EventBookingPaid Event = "booking_paid" 24 EventContributionPaid Event = "contribution_paid" 25 EventShotgunOpensSoon Event = "shotgun_opens_soon" 26 EventShotgunClosesSoon Event = "shotgun_closes_soon" 27) 28 29type Message struct { 30 // Unique ID for the notification scheduling request. 31 Id string `json:"id"` 32 // When to push the notification 33 SendAt time.Time `json:"send_at"` 34 // Clear scheduled jobs for the given event types on the object_id before scheduling notifications 35 // TODO: generate jsonschema annotation 36 ClearScheduleFor []Event `json:"clear_schedule_for"` 37 // Type of event that triggered the notification 38 // next-line-generate event-enum-jsonschema-values 39 Event Event `json:"event" jsonschema:"enum=clear_stored_schedule,enum=show_scheduled_jobs,enum=save_schedule,enum=restore_schedule,enum=restore_schedule_eager,enum=clear_schedule,enum=new_post,enum=godchild_request,enum=custom,enum=test,enum=godchild_accepted,enum=godchild_rejected,enum=pending_signup,enum=login_stuck,enum=booking_paid,enum=contribution_paid,enum=shotgun_opens_soon,enum=shotgun_closes_soon"` 40 // Churros ID of the ressource (the ticket, the post, the comment, etc) 41 // Used to determine to whom the notification should be sent 42 // For godchild_request, this is not a user id, but a godparent request id. 43 ChurrosObjectId string `json:"object_id"` 44 // Notification title 45 Title string `json:"title"` 46 // Notification body 47 Body string `json:"body"` 48 // URL to go to when the notification is clicked 49 Action string `json:"action"` 50 // Additional action buttons 51 Actions []struct { 52 // Label of the action button 53 Label string `json:"label"` 54 // URL to go to when the action button is clicked 55 Action string `json:"action"` 56 } `json:"actions,omitempty"` 57 // URL to an image to display in the notification 58 Image string `json:"image,omitempty"` 59}