covid-vaccine-spotter
covid-vaccine-spotter copied to clipboard
WIP: Implement notification sending
I have started on an effort towards enabling the ability for users to subscribe to email notifications that will send through SES.
Here is a screenshot of the added UI modal for signing up for notifications

That form will submit to a new lambda endpoint (fronted by an API gateway) that upserts into a new notifications collection the email address and lists of stores that have been subscribed to.
Within the various refresh scripts, we can implement a quick check to see if an individual store has transitioned from no openings to having openings (I have only currently done this for walgreens and walmart).
When that transition is detected, there is a new notify function created that handles finding the users to notify and sending out the emails. It takes in data about the store in question from the caller.
There is a lot of work still to be done for this. The email bodies need work, the other stores need to be implemented, there are a few things that need to get paramaterized, clean up form submission UI, etc. But figured I would share this in an early stage for any early feedback.
I also added new defined functions for the findStores handlers, since that made it easier for me to run locally with sls invoke --local. Happy to remove those if they aren't helpful.
@mattk42: Sorry I haven't gotten to this yet! I still really want to get this integrated in, since I think it would be tremendously useful, I've just been busy trying to stabilize and cleanup other things, but this looks like a great start.
I still haven't gotten to dig too deep into this, but one general thought I've had: In light of some of the database cleanup and standardization I've been working on (which I know wasn't in place at all when you started, so sorry this is so quickly changing), I'm wondering if that might make some of this easier to implement. Rather than having users select the specific stores to subscribe to, I'm wondering if it would make more sense to have users enter their zip code and then select a notification radius (eg, 10, 25, 50 miles, or the entire state). Now that most of the data is in PostgreSQL with PostGIS, this could then make this type of radius-based query pretty easy in the database. This could have the benefit of automatically including new stores within the user's desired radius, as we add new providers, rather than requiring them to explicitly subscribe to specific stores.
I can definitely lend a hand with all this if you want help, but just wanted to get your thoughts on what you think about this radius-based subscription model versus the store based approach. If you were really after a specific store, then this might have pitfalls, but I'm thinking this might help more users find new stores as we add them. I also realize none of this was easily possible when you started, but I'm hoping some of the underlying database changes could make this easier if you think it would be a good path to go down.
Thanks again and sorry I haven't gotten to this yet!
Thanks for all the work on the current package @GUI and for these updates @mattk42. I am liking the radius based approach, just created something pretty rudimentary here. Note, I will likely clean it up in the next few days or so to make it more extensible, but I found it pretty useful!
I worked on a python messaging program for my personal use to send text messages. I just wanted to note here that text-messaging could easily be incorporated in this e-mail project because most mobile companies have an e-mail address to send directly to SMS. For example, "<10digitnumber>@email.uscc.net" for US-Cellular. Thus the user would only have to put in their number/address to receive text messages. I find that text messaging worked extremely well for getting fast notification of openings.
Here is a link to an extensive list of these e-mail addresses: [https://avtech.com/articles/138/list-of-email-to-sms-addresses/#u]. I do not know much about the accuracy of this list, but only one of the two listed for US-Cellular works.
Being able to alert on specific vaccines would be a huge plus. Much of the traffic in the local vaccine hunter FB group revolves around people trying to track down a specific shot.
A zip code and notification radius is much more useful than subscribing to individual stores. There are hundreds of pharmacies in a major metro area, and it is easier to decide how far you are willing to drive to get a shot than to pick all the pharmacies within driving distance.