I’m trying to have users signup with a zip code, username and password to this application…
Using this ZIP CODE I want to have email alerts go out to the user when certain conditions exist (for example, someone posts something for sale in their area, an Alert should go out to the people who signed up for this alert).
Is this possible to be done in Bubble?? How is this done on the high level? (low level I will sort out of course)
Any help appreciated as I’m stuck trying to figure this out.
Well if there is an action from another user that triggers sending the email, you just add it to the workflow. For instance, a thing is created with a certain zip code, then you can have an action send email to all users whose zip code is that zip code.
But the question is how can I set the User up to receive a notification by email for something like for example: a new Garage Sale within 20 KM of their inputted zip code?
So…
User creates alert for Sale Items within 20KM of their inputted zip code.
When other user creates listing and it’s within 20km of the other users zip code, user A (the one who signed up for the alert) receives an email notification.
whenever a new listing is created you trigger a workflow with an action “schedule API workflow on a list”. (you can do it 1 second after the button submit was clicked for example). In the “list to run on” do a search of users who are located within 20 KM of inputted zip code.
create an API workflow (that will be selected in step 1) which would send the email.
You can use this API https://www.zipcodeapi.com/ for operations with Zip codes.
In particular, to get primary location for an API, this call can be used https://www.zipcodeapi.com/API#zipToLoc
and then based on the location returned by that API you can use Bubble’s functions to filter data.
My issue with this is that it doesn’t work within Canada.
Google places is populated with all Canadian zip codes as far as I know. Is it not possible to set up this notification using Google Maps radius around a given zip/postal code?
why don’t you simply use a search box with auto complete with dynamic data set to "geographic addresses? If the user types in the zip code there it will automatically suggest the primary location for that zip code. And then you can use that location to calculate the distance from it.
i tried and it seems that both US and canadian zip codes work. Try it out here
If you just store the text Zip code as an address you can do this, but as levon says it is going to be safer to use the search box and geographic address as I would imagine zipcodes/postcodes are not unique and you might get some odd locations.
From there you can use native bubble functionality on the search “within x miles” of the entered location. You don’t need an external API for this.
It was me who posted the link not Nigel
The app is my private one that’s why you could not open it but you don’t have to import anything
Simply choose search input and then in its settings chose dynamic options geographic addresses
It gets data from google maps automatically
Then you can use another element or workflow to calculate distance from that search input
You shouldn’t need to import anything, Bubble links to Google to pull this back, and that should be up to date.
Bubble allows you to have search criteria based upon the distance between two locations. So all you really need to do is store those locations in your database, and you can search on them.
I’ve now created a thing called “notification” which has the fields Email (text) and zip code (address) and it’s collecting the data well.
My question is how or where do I trigger something that “checks for changes” at set times?
For example, I don’t want to send someone a notification in the middle of the night when someone posts a new flight within their notification area… I want to wait for a specific time (ex. Friday nights at 7pm).
So it should be set at a specific time to look for specific changes and if there is a new Flight found within X KM of their zip, the email alert is sent to them.