Send confirmation emails to a list of users

Hi bubblers,

I’m building an app where one user creates accounts for a list of others then sends them a welcome email. I’d like the welcome email to include an email confirmation link. I can do this with a single user by creating a token and then sending it within an email. Is there any way to do this with a list of users? I tried using a back-end workflow to iterate through each user, and it sent the email but the link didn’t change the user’s email confirmed to ‘Yes’.

Any ideas would be gratefully accepted. I can default back to a two step process but it isn’t ideal for user experience.

Steve

Sorry to bump this, but there are a lot of questions above it now. Can anyone respond to this with a suggestion?

A while ago, we created a helpful video that provides a solid foundation for the process you’re looking to implement. Although the video focuses on uploading a CSV file of users, the core steps can still be applied to your specific use case.

To adapt the process, simply follow the tutorial until you reach the backend workflow section. At that point, add an extra step to send each user a confirmation link via email.

You have a couple of options for handling email confirmations: either use Bubble’s built-in feature, or create your own. To build a custom solution, you can use a simple Boolean value stored within a user profile, which can be updated when they visit a dynamic page.

Check out the video for guidance, and happy Bubbling! :blush:

Thank you for your help with this, but I’m still struggling. Reading through the manual and testing different arrangements I might have figured out the problem - you can only seem to generate an email confirmation token for a user who is currently logged in. I don’t know if this is true or not, but I can get the backend workflow with iteration running fine, sending emails to the list of users, but the confirmation links in the emails don’t change the user whose email address they are sent to’s status to Yes. The confirmation links do, however, when clicked, change the email-confirmed status of the user who was logged in when the workflow was triggered.
I will try to find a way around this by iteratively logging in each user in the list through the back-end workflow, but I’m doubtful if this will work when the users don’t have passwords yet (they are new users generated by someone else. The fall-back position, as you suggest, is to create a custom user-email-confirmed Boolean and send each user an email with their user-id embedded as a custom link, which then detect on page load and updates the Boolean to ‘yes’

So I’ve managed to create a back-end workflow to email a list of users clickable email-confirmation links by iteratively generating a temp password then logging them in and generating an email-confirmation token, then emailing them the token. It’s pretty messy and I haven’t figured out how to log the original user back in yet. I’ll set out how I did the whole process another time once I’ve properly tested it in my app.

So I thought I’d share my final solution below.

The Challenge

I need an admin user to be able to enter a list of email addresses of people in their organisation to sign them up. Each user in the list should be sent an email link, which when they click on it will take them to a password reset page, then their user profile.
Key challenge: They should not have to complete a separate email-confirmed process as they have already confirmed their email address by clicking on the password reset link.

Solution:

In the workflow for adding the nominee to the list:

  1. Create an account for someone else
    Must include Email but can include other fields in your user data type as required.
  2. Make changes to the Org (add them - if applicable)

In the workflow for the Create accounts for list of nominees button (i.e. confirming the list of new users):

  1. Schedule API workflow
    Scheduled date: Current date/time
    users: repeating group (whatever your nominee list is called)
    iteration: 1

In the API workflow with the following parameters:
Key: users Type: User (Is a list/array ticked)
Key:iteration Type number

  1. Send password reset email:
    Email to reset: users:item #iteration’s email
    Subject: whatever you want
    Body: whatever you want to indicate they will be taken to a password reset page then onward to whatever profile page you choose.
  2. Schedule API Workflow:
    API Workflow: This current workflow ie. loop it
    Scheduled date: Current date / time
    users: users
    iteration: iteration + 1
    only when iteration < users:count

In the workflow for the password reset button, create the following steps:

  1. Reset password
  2. Log the user in using the password from the input fields
  3. ‘Send confirmation email’ as a token.
  4. Go to page (whichever page you want them to land at) / send more parameters to the page: key: confirmation_email = result of step 3

You will need to create an ‘only when’ current user’s email-confirmed=“no” on the workflow, and create another separate one for when it is just a user resetting their password for whatever reason.

I hope someone finds this solution helpful. I searched extensively for a solution and experimented for a long time - this seems to be the best solution I could find (but very happy if others can offer improvements!) I find bubble much less frustrating when I get stuck than with plain code - I’ve actually quite enjoyed figuring this out!

This topic was automatically closed after 70 days. New replies are no longer allowed.