I’m currently trying to setup my app to send an automated email to new users 20 mins after they sign up but I’m struggling to work out how the API workflow part works. Specifically, I’m confused with what I need to enter in the Endpoint box shown below:
This is yet another wonky Bubble nomenclature issue. The things called “API Workflows” are multipurpose SERVER SIDE workflows that may or may not have ANYTHING to do with calling Bubble as an external API.
In your case, the “API Workflow” is nothing but a workflow you want to kick off at some pre-scheduled time. In this case, you do not want to expose the workflow as a public endpoint. It’s just for your app. (So to call this an “API Workflow” is silly and scary.)
The permissions settings can be useful though. The point of them is this: By way of example… Let us say that you have a button on your site like this:
When clicked, you throw up a pop up that lets the user compose a message that is destined for you, the admin. When they hit “send”, you kick off one of these API Workflows to send an email to another User (you and/or other admins).
However, due to Privacy Rules, random user has no permission to get your email (your User object’s email address).
What to do?
If “ignore Privacy Rules” is not checked, the workflow will fail as the User cannot get your User object’s email. Checking the box lets the workflow run like an administrator, a superuser, someone who has access to everything.
This is what you want in this case. You’re basically saying, “hey, app, after the user does X, schedule an email to be sent to them from the app at current date/time:plus minutes 20”. Also, “though the user has no rights to request this, honor the request anyway.”
I’ve followed both pieces of advice. Makes total sense but still can’t get this working. Is there something I’m missing? Maybe some other checkbox needs to be ticked/unticked?
Here is the full workflow that I’ve got so far. Yes, I’m triggering it as a scheduled api workflow although I can’t see it in the logs, although I’ve never looked at the scheduled logs before. Thanks so much
Ah, I see what you mean. Just tried that but didn’t seem to work either. The issue with this is that the API workflow is set to send to “current user” and I can’t see any way round this as I can’t access input fields on the page that triggers the workflow?
Ok, I wasn’t 100% sure what you meant but I created a text box to display the “current user’s email” and it displays the correct email straight away. Not sure if this is what you were meaning?
However you need to see if that is being passed to the API workflow. The workflow is run on the server, so may be different.
As there is no “screen” on the server, you would need to output to a table. Then have a look to see what is in there. Will give you an idea of where the problem is.
I’ve tried this and everything seems fine here too. Email address is written to the table successfully. I feel like I’m messing up the API workflow somewhere. Has anybody created a video on API workflows?
Thanks so much for all your help. The issue was on the Sendgrid side. Not entirely sure what caused the problem as I played around with a lot of settings, but I suspect it is because my domain was not authenticated s I had not added their DNS records.
Thanks again for all your help. I really appreciate that!