Skip to content

View notification HTTP request, with option to filter CSV output, for OneSignal

Notifications You must be signed in to change notification settings

dombartenope/viewnotifs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Steps for adding filters

  1. First you'll need to figure out if the filter is listed in the headers in main.go
 		"DelayedOption",
		"DeliveryTimeOfDay",
		"Errored",
		"Failed",
		"ID",
		"IncludePlayerIds",
		"IncludeExternalUserIds",
		"IncludeAliases",
		"IncludedSegments",
		"SendAfter",
		"CompletedAt",
		"Successful",
		"Received",
		"TemplateId",
		"TimeSentSpending",
  1. Go to filter.go and copy the NoFilter function to work off of a blank slate
  2. Reference the above examples in this file to see how filters are passed into the switch statement and the logic gates that should be used Example of filter func
  3. In userChoice.go, add a search to parse the .env file for the specific value you're looking to input into the filter Example of env parsing
  4. Still in userChoice, go to the top and add a case that matches a string that the user can listen for, and add that to the stdnin fmt so the end user can input the keyword correctly Example of input
  5. The case should call the search function you've created if met Example of user choice case
  6. In main.go, add the string you're user inputs to the switch statement to make the request fire off that specific filter function. Example of main choice case

The end UX should look like this : Test Usage of CLI Tool

Time Spent Sending is a custom column that is intended to show the time in minute and second difference between the "SendAfter" and "CompletedAt" values

The notif.go structs are intended for the response parsing. If more columns are needed you'll need to add more properties to these structs and add headers to the headers slice in main.go

TODO :

  • Add filtering and writing to the csv, to the response struct directly as methods
  • Add platform stats as an additional struct to pass delivery data to

About

View notification HTTP request, with option to filter CSV output, for OneSignal

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages