Change user's email address via API without confirmation

AI-generated summary

The discussion revolves around changing a user’s email address via API without triggering a confirmation email in a Discourse implementation. paully21 wants to achieve this to prevent incomplete email address changes due to users not confirming the change via email. The challenge arises because some users want a different Discourse notification email than their main association notification email.

codinghorror suggests that this might be a “self-inflicted wound” due to the complexity of handling different email addresses for the same user. pfaffman questions how to determine which email address to change, but paully21 clarifies that the change would be made only if the old email address matches both the ERP system and Discourse.

pfaffman offers to help create a plugin if necessary, and codinghorror points out that Discourse now supports multiple email addresses per user, which might address the original issue.

Is there a way to change a user’s email address using the API without triggering a confirmation email?

Our users are actually members of our association and when they submit an email address change directly to staff, the staff member changes the contact’s record in our ERP system. Then the staff member needs to log into our Discourse implementation as the user and submit an email address change.

Staff members are complaining that the confirmation email is confusing, not seen or disregarded by the user and therefore the email address change never completes.

I’m trying to kill two birds here:

  1. I would like to make it so the change email address change can be made right from the ERP system.
  2. I want to eliminate the incomplete email address change submissions (because of no confirming email action was taken).

We don’t want to use SSO overrides email, because we have a handful of users that want a different Discourse notification than the main notifications from the association.

I would say this is a self inflicted wound at that point?

Hey, Paul. I’m still happy to help on this, but Jeff makes a point. Just how will you know whether someone wants a different address? You’ll just change it via the API on ERP but let them change it in Discourse if they want to?

The idea would be, if the request is made to change the email address and the old address matches the ERP system AND Discourse, then change it in both. Additionally, they may have an online or paper form that asks if the email change should include Discourse.

Another salient point here is: nearly all the association members use Discourse as a mailing list (mailing list mode) and never visit the Discourse instance site. So, having to go to the site to confirm the email address change adds a layer of confusion for them.

I realize this is not a normal use case for mainstream Discourse installations, but I have been asked to make it happen, so I’m barking up the tree.

Worst case it’ll take a plug in. If I can’t do it, I’d fit a guy. If you want to give it a shot, search here for ‘reverse engineering’.

Discourse supports multiple email addresses per user now, does this address your original issue?