4tals / LinksForIsrael

פורטל יוזמות - חרבות ברזל
https://linksforisrael.com
22 stars 25 forks source link

Add notifications for new content (similar to linktree) #162

Open ohadschn opened 11 months ago

ohadschn commented 11 months ago

A user could register (possibly at the category/subcategory level) and get notified whenever new links are posted. Not sure how feasible on github pages, also probably lower priority.

4tal commented 11 months ago

We can add small Google form email and category and send them email in case there's a new initiative

4tal commented 10 months ago
  1. Overview: A Google Spreadsheet will use Google Apps Script to provide a webhook endpoint. This endpoint will handle incoming HTTP POST requests containing email and category lists, and store them directly into the spreadsheet.

  2. Google Spreadsheet Setup:

  3. Create a new Google Spreadsheet Define two columns: "Email" and "Categories".

  4. Google Apps Script: Create a new script file from the Google Spreadsheet by clicking on Extensions > Apps Script. Write a script that: Creates a doPost(e) function to handle HTTP POST requests. Parses and validates the request body content. Appends valid data to the spreadsheet.

  5. Script Example:

function doPost(e) {
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  var postData = JSON.parse(e.postData.contents);
  var email = postData.email;
  var categories = postData.categories.join(", "); // Convert array to string

  // Append data to the sheet
  sheet.appendRow([email, categories]);

  // Return a success message
  return ContentService.createTextOutput(
    JSON.stringify({"status": "success"})
  ).setMimeType(ContentService.MimeType.JSON);
}

Later we'll connect it to the frontend

ohadschn commented 10 months ago

Later we'll connect it to the frontend

That sounds like the easy part - I suspect the more challenging part would be actually detecting category changes and sending out an arbitrary amount of email notifications.

Having said that, is this even an interesting scenario for our customers?

4tal commented 10 months ago

I think we can't know for sure until well try, and development cost is small

ohadschn commented 10 months ago

I think we can't know for sure until well try, and development cost is small

@4tal you are right of course we can't know for sure, but that can be said about anything :) Ultimately, we're going to have to prioritize by our best estimations, and in this case I just don't see it as a big part of our main scenarios, which as I see them are:

  1. People looking to help in some field - they visit the site, look at the options there, and zoom in on something. Next time they want to volunteer, they'll visit the site again.
  2. People looking for help - again, they visit the site, find the most applicable initiative, and continue there. Next time they need help, they'll visit the site again.

It's harder for me to imagine the scenario where someone says "I want to be informed of every new initiative in the area of X the moment it's added to the site".

4tal commented 10 months ago

Let's do the following. Add subscribe button with and on press it will pop-up "coming soon" and we'll see if that button is been pressed at all @ohadschn

ohadschn commented 10 months ago

LOL that is pretty evil! So I can't say no