Giter VIP home page Giter VIP logo

Comments (15)

macropin avatar macropin commented on June 2, 2024

Somewhat related to #54

from django-registration.

joshblum avatar joshblum commented on June 2, 2024

@sircco does the fix in #54 solve your problem?

from django-registration.

sircco avatar sircco commented on June 2, 2024

looking at code, i don't think that this does it unless i can override this line on per case basis.
from_email = getattr(settings, 'REGISTRATION_DEFAULT_FROM_EMAIL', settings.DEFAULT_FROM_EMAIL)

Our app is whitelabel, meaning that more than one domain can use it, register its own customers (and send registration emails)

from django-registration.

dicato avatar dicato commented on June 2, 2024

@sircco the use case makes sense 👍

If you'd like to implement we are happy to review.

from django-registration.

joshblum avatar joshblum commented on June 2, 2024

strawman could be to allow REGISTRATION_DEFAULT_FROM_EMAIL to be a python dotted path.to.function which would point a function that take site as an argument and does custom logic to return the email? Thoughts?

# settings.py
REGISTRATION_DEFAULT_FROM_EMAIL = 'path.to.function'

# path/to.py
def function(site):
   return '[email protected]'

from django-registration.

joshblum avatar joshblum commented on June 2, 2024

(probably cleaner to have a separate settings variable REGISTRATION_FROM_EMAIL_FUNCTION or similar but same idea)

from django-registration.

sircco avatar sircco commented on June 2, 2024

How about something like this, overriding default if variable not provided
during instantiation.
I didnt look too much at the code recently but here is some dummy code to
explain my idea.

class Registration(Object):
def init_(self, mail_from=None, .... ):
self.mail_from, = mail_from or
settings.REGISTRATION_DEFAULT_FROM_EMAIL

On Tue, Jun 7, 2016 at 6:14 AM, Joshua Blum [email protected]
wrote:

(probably cleaner to have a separate settings variable
REGISTRATION_FROM_EMAIL_FUNCTION but same idea)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#26 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AJ9osiYzs0R4cFXyRZeY07tAUzef4qE-ks5qJPASgaJpZM4Da72R
.

from django-registration.

dicato avatar dicato commented on June 2, 2024

I think it's acceptable to use static configuration for this as well. You can use a dictionary to map emails to sites, just as an example.

from django-registration.

joshblum avatar joshblum commented on June 2, 2024

@sircco would a static configuration meet your use case?

from django-registration.

sircco avatar sircco commented on June 2, 2024

It will work for now. If we get so much traffic on our whitelabel site that we can't manage static setting we will think of something and submit code for review.

from django-registration.

joshblum avatar joshblum commented on June 2, 2024

Great. Do you want to take a first stab at implementing this?
El El mié, jun 15, 2016 a las 01:14, Damir [email protected]
escribió:

It will work for now. If we get so much traffic on our whitelabel site
that we can't manage static setting we will think of something and submit
code for review.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#26 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ABF01NyzOHc4NZQXqii166U7mMXFzlHSks5qL4pFgaJpZM4Da72R
.

from django-registration.

joshblum avatar joshblum commented on June 2, 2024

@sircco take a look at #294 and let me know if this address your use case!

from django-registration.

sircco avatar sircco commented on June 2, 2024

should work fine!

from django-registration.

joshblum avatar joshblum commented on June 2, 2024

Awesome! I'll leave this open until #294 is merged in

from django-registration.

joshblum avatar joshblum commented on June 2, 2024

closed by #294

from django-registration.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.