Bulk Change Email domain

Change e-email domain

When domain names change, all of the users need to be updated. This pipeline asks for user input, demonstrates what actions it will take, updates the user table accordingly, and then outputs a report.

Using --help to discover what inputs this command requires:

The only required parameter is --users:

mbpy pipelines change-email-domain --users students

The script will then ask you to input the values needed

The value to change (after the @): example.com
The value to change it to: subdomain.example.com

It will then download from the API, and present the selected users that will potentially be changed:

Notice that it automatically selects students whose email address matches

As we can see, there are lots of active students with this email address. The next step will display the first 10 and last 10 records that will be changed (not real student information):

List of all the requests that will be enacted via the API

That gives us the confidence that it is doing example what we are expecting it to do.

The operation to make the necessary API calls (PATCH on /students/{id} endpoint) commenses, with a progress bar:

The user needs to confirm before proceeding

Once the operation is complete, it provides a simple table indicating status code:

Just confirms that there were no unexpected errors

Finally, it provides a report of all actions that were taken. In a support context, this report can be sent back to schools for confirmation:

Notice the response includes the updated email address, indicating it was changed.

Last updated

Was this helpful?