Is this possible with Sendgrid/Twilio?

Options
Hi all,

I'm in the learning experience space and created a "daily practice" tool in landbot that guides the user through a different learning experience.

I'm now trying to figure out the notification process.

I'm giving users the option to choose which days of the week and what time of day (their time) they want to receive a notification.

I had a developer build out the logic for this in Bubble's logic, but his logic didn't make a ton of sense to me... (as in, extremely complex and multi-stepped)... and then he dipped.  So I'm looking to build a better way.

But ultimately the challenge is how to create a unique weekly schedule for each user that's running in the backgroudn.

Thanks in advance!

Mitch

Comments

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
    Hey  - are you asking if you can use Twilio/Sendgrid to push notifications to your users at a time they specify? Yes, 100%.

    You would put the logic in a background task and run it on a cadence of increments that you allow your users to set a reminder (i.e. every minute, every 5, every 15, etc.)

    Query the records from the table with notifications, filter them based on those that fall within that minute. 
    Potentially use an addon for the user contact info if it's not on that table
    Then use a For Each Loop to either send a twilio sms or sendgrid email
  • Mitch
    Mitch Member
    Options
     Appreciate the fast reply!

    Does the increment model work if people want to skip days?  

    For example, let's say a user wants emails only Tuesday and Friday at 3pm EST.  I'm imagining:
    1.  create record in a notification table.  Day field holds Tuesday, Friday in array and time holds 3pm EST (or unix?) 
    2. somehow create the logic to start the background task so that it starts on the next instance (so Friday if today's Thursday)
    3. Repeat the instance every 24 hours with a logic that says:1. what is today?
    2. is today in notification day field?
    3. if yes, send notification, if no wait 24 hours.

    Does that make sense?  Is there a better way?

    Thank you so much!

    Mitch
     


    so store that in an array in a notifications table
    1. set up the background task to start