This repository has no description
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 object_id before scheduling notifications
35 ClearSchedule bool `json:"clear_schedule"`
36 // Type of event that triggered the notification
37 // next-line-generate event-enum-jsonschema-values
38 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"`
39 // Churros ID of the ressource (the ticket, the post, the comment, etc)
40 // Used to determine to whom the notification should be sent
41 // For godchild_request, this is not a user id, but a godparent request id.
42 ChurrosObjectId string `json:"object_id"`
43 // Notification title
44 Title string `json:"title"`
45 // Notification body
46 Body string `json:"body"`
47 // URL to go to when the notification is clicked
48 Action string `json:"action"`
49 // Additional action buttons
50 Actions []struct {
51 // Label of the action button
52 Label string `json:"label"`
53 // URL to go to when the action button is clicked
54 Action string `json:"action"`
55 } `json:"actions,omitempty"`
56 // URL to an image to display in the notification
57 Image string `json:"image,omitempty"`
58}