Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple email addresses per user #170

Open
racke opened this issue Mar 17, 2015 · 11 comments
Open

Multiple email addresses per user #170

racke opened this issue Mar 17, 2015 · 11 comments

Comments

@racke
Copy link
Member

racke commented Mar 17, 2015

While it make sense to have a single email address to identify, I'm running in cases where it would be useful to somehow attach additional email addresses to an account.

Examples:

Merging similar accounts
ERP sync
BTS / Mailing lists.

Any idea how we can add this in a sane way to the schema?

@SysPete
Copy link
Member

SysPete commented Mar 17, 2015

User has_many Emails? We can also use Email to store addresses used by the site perhaps?

@hexfusion
Copy link
Contributor

I was just thinking about this. What if we had a numeric primary key as the the real username then the 'primary' email address as an alias. This way you can change your primary email and use it as your login without actually changing the username in User directly. Not directly related to your issue @racke but I think this all needs a revisit.

@racke
Copy link
Member Author

racke commented Mar 17, 2015

Our primary key on users is users_id.

@racke
Copy link
Member Author

racke commented Mar 17, 2015

Which email addresses you thinking about SysPete?

@SysPete
Copy link
Member

SysPete commented Mar 17, 2015

@racke maybe a shop has many different addresses that it sends from depending on context? I don't have specific use case just thinking out loud.

@hexfusion
Copy link
Contributor

ok then I am mistaken all together 😎

@racke
Copy link
Member Author

racke commented Mar 17, 2015

So let's start collecting use cases before we decide about schema changes.

@SysPete
Copy link
Member

SysPete commented Apr 6, 2015

For use cases in initial issue comment from @racke we'd need to add table Email. If no objections then I will add.

@SysPete
Copy link
Member

SysPete commented Apr 6, 2015

Columns I can see in Email:

  • emails_id
  • email
  • name
  • priority
  • created
  • last_modified

@SysPete
Copy link
Member

SysPete commented Feb 26, 2016

There is another option for alternate email addresses: store them in Address class. We'd probably want to make country_iso_code nullable if we do this but is saves creating a new Email class.

@racke
Copy link
Member Author

racke commented Feb 29, 2016

Also we need a generic reset token mechanism which is bound to an email address. Currently we only support password resets, but it would be useful for newsletter subscriptions as well. You might not want to enforce creation of a new user to a newsletter subscription.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants