Two emails for one user

I was trying to tweak my user to allow me and use either one of my 2 emails and I got this weird behaviour.

Under preferences if you set it up to something like me@example.com;also_me@example.com it will work, and you’ll get the confirmation email on both.

But when trying to login, now you’d have to use me@example.com;also_me@example.com while trying to login with oauth, you can only use the first one.

I’m not sure what to do with this info or if it has any use for the developers. But I did wish to know if there is some way to make the oauth work with more than 1 email for the same account. I’d enjoy it very much, probably for no good reason. :stuck_out_tongue:


Revised spec:

Multiple email addresses on one account

Discourse’s email integration provides users with the option to post and reply via email. Currently, Discourse only allows one email per user; however, most people these days live with more than one email address. Messages are rejected when users post or reply from an account different from their email on record with Discourse, which can be frustrating and confusing for users. We would like to allow users to optionally add one or more alternate email addresses to their profile. When any message is received from an alternate email address, it would be treated as if it came from the user’s primary email address.

Specs

  1. Add alternate email addresses to user’s account.
  2. Send email messages from alternate address, generating posts as if they had been received from their primary address.
  3. Do not accept an alternate email address if it is already in use as a primary or alternate email address for any user (each email address must be unique across all users).

Stretch goals

  • Send a reply to an alternate address the first time it is used, informing the user their message will be treated as if it came from their primary email address and any notifications will be directed only to their primary email.

5 Likes

I strongly do not recommend doing this.

8 Likes

I agree with @codinghorror that this opens a “can of worms”, but it would help some of our users currently. The reason is because we’re allow “email-in” to post topics or replies. However, many of our users have multiple e-mail addresses, and I’ve seen that they don’t always consistently use the “correct” one in their profile to send things in. Because there’s no notification of failed posts, they just assume their reply/post worked correctly and never think to go back and check.

I’m not sure that this is a good approach, but as things stand at this moment, I feel a duty to +1 this suggestion on behalf of my users who have had difficulty using Discourse as a result.

3 Likes

Sounds like better error handling for mail in is the answer to the problem you are describing, @downey, which is a concern for me and presumably many others at this stage as well.

Meanwhile in my community people have become accustomed to being able to do what you describe thanks to the Multiple E-mail Addresses drupal module. They can specify a list of additional email addresses that can then be used to mail into groups or get a password reminder sent to them. But only one of them remains the primary email address.

This has also been helpful for us in managing our community and supporting people who otherwise might become unreachable because their email address stopped working or got hijacked by a scammer etc.

The way this might be presented to the user is via an additional field where they can provide “backup email address(es)” in a comma separated list.

2 Likes

We allow our project’s community members to maintain a primary and any number of secondary (back-up) e-mail addresses in their LDAP directory profile. Through SSO, we pass the primary to Discourse.

Those same users often subscribe to a given mailing list with several accounts, and set all but one to not send copies of posts. (Which means they only get one copy but can reply/send from any number of addresses.) I don’t necessarily think this is good practice, but it is in fact what people are doing.

I think finding a way to allow multiple addresses or synchronize them with a provider would be useful for some users, but at a minimum it’d be nice if they knew things didn’t work when they tried to use a different address.

They would all need to be validated via a magic GUID link sent via email, though.

3 Likes

yup - that makes sense

1 Like

Other than the awesome “backup email address(es)” idea I thought what really triggered me to want more than 1 email to begin with. Well, I have many different emails… But oauth works mostly with my main one.

I wanted to use oauth to login, but display a different email on my profile.

So, maybe a better idea (for my original intent) would be a “profile email for public display” field, which would still need to be validated as Jeff suggested (well, not needed, but better if we do). This does not exclude the “backup email list” idea, it’s just a different one. :slight_smile:

Maybe I should try to go and cluelessly attempt to implement it myself and make a pull request… :open_mouth: Should I?

Sure - this might be a low hanging fruit approach to starting to do pull requests.

There may already be a way to add profile fields, though, and your use case seems pretty unusual. I can’t imagine many people would want this.

1 Like

I just looked at your Profile and saw no email address.
Are you proposing there be such a field?
Could you not put it in another?

1 Like

I’m actually afraid to even start on trying after reading this. Better continue this discussion there, if you will →

You’re probably right. For whatever dumb reason, I always thought my email would be displayed. Maybe the private fields should show to ourselves, somehow, so we know they’re actually private and for our eyes only.

I’m back to thinking about this and would appreciate guidance.

We are considering opening up discourse for a community that already has WordPress logins but don’t necessarily want to set up SSO and lose all the great benefits of social logins, invites, spam user checking etc in discourse. Many people (myself included) use a different email addresses for the WordPress site than we do for our other logins around the web including Facebook, Twitter, Google+ etc.

So far we’ve been able to tightly control the discourse user accounts, because they are all staff, but once we open up discourse for public logins to our wider community and invite folks to start logging in, we will start getting a divergence between the email addresses people use in wordpress and in discourse. This will bring difficulties with communicating with folks (sending them multiple copies of our newsletters etc) as well as generally with having insight into our community and who’s signing in and participating actively.

So I have returned to thinking that it would be very useful to allow people to add one or more backup email addresses in a comma separated list, or to be able to add it for them. And they can then log in via whatever method or email address they desire and still be able to get in and be identified as the same user, and as long as one of them matches with their WordPress account then we’re golden! The code we write to connect the accounts and pull user info and activity would look for a match across all the user’s email addresses.

One address would of course still need to be established as the primary email that they use to get notifications form Discourse.

2 Likes

Agreed – we still need this too. People still try to email in to Discourse but use the wrong sending address (so get error messages), and hate Discourse (and become more reluctant to adopt it) as a result because they have no way to define multiple addresses. :frowning:

5 Likes

Can you mock up ui of how you think this would work?

To get people started thinking, here’s what we do on our directory system. It requires some narrative of course to explain what “primary” means.

3 Likes

Facebook also has multiple e-mail addresses:

6 Likes

And here is Google’s for good measure:

Display:

Clicking Edit for “Other emails” takes you to this:


Although this doesn’t specifically allow you to select the primary address (as I have a GMail account linked which must always be primary)

1 Like

Here is how citrix does it, for “alternate email” purposes in case something goes wrong with your main email address. Also interestingly has a field for providing a twitter handle. Nice popup link for “Why we ask” as well.

Of all these, I think I like @gerhard’s facebook model best. Add as many emails as you need that can be used to log in or email from or for SSO, and choose the “primary one” that gets the notifications.

3 Likes

This has now become an urgent priority for my communities and we’d like to have it ASAP. What can we do to make it happen? (besides moving hosting to discourse.org/buy, @codinghorror :smile: )

How exactly did it turn into urgent?