I’m trying to set up a workflow on the “send message” button that will send a message to another user in the platform and begin a discussion and then also send an email to the recipient of the message to alert them that they have a new message on their dashboard. The message and discussion part is working well, but the emails are not being sent. All of my other emails are working fine, so I think it may be a problem with how I set up the email in the workflow, but I don’t know how to fix it. I tried using discussion’s users: last item’s email and it did not send an email, and then I tried using discussion’s users: first item’s email and it still did not send an email. Can anyone tell me how to set it up correctly?
@jolieparker This usually happens because, at the moment the email step runs, the discussion’s users list isn’t fully set yet. So even though the message is created, Bubble doesn’t reliably know who the “other user” is.
The easiest fix is to send the email to the recipient you already know. Instead of pulling from discussion’s users, pass the recipient user into the workflow and use recipient’s email in the send-email step.
If you really want to reference the discussion, another workaround is to schedule the email a few seconds later (or via a backend workflow) so the discussion has time to finish creating.
