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

Cant overwrite the confirmation signup email subject. #2625

Closed
adrenaline681 opened this issue Aug 5, 2020 · 5 comments
Closed

Cant overwrite the confirmation signup email subject. #2625

adrenaline681 opened this issue Aug 5, 2020 · 5 comments

Comments

@adrenaline681
Copy link

I was able to overwrite the HTML template by adding this to my templates folder:
account/email/email_confirmation_signup_message.html

But now I'm trying to overwrite the subject of the email by adding this:
account/email/email_confirmation_signup_subject.txt

But it doesn't do anything. I still get the same default subject

@9mido
Copy link
Contributor

9mido commented Aug 5, 2020

Watch https://youtu.be/dXZim_jgaiI?t=704

project_name/templates/account should be identical to this:

https://github.com/pennersr/django-allauth/tree/master/allauth/templates/account

project_name/templates/account/email should have this:

https://github.com/pennersr/django-allauth/tree/master/allauth/templates/account/email

Then you should be able to edit them.

@adrenaline681
Copy link
Author

adrenaline681 commented Aug 5, 2020

Watch https://youtu.be/dXZim_jgaiI?t=704

project_name/templates/account should be identical to this:

https://github.com/pennersr/django-allauth/tree/master/allauth/templates/account

project_name/templates/account/email should have this:

https://github.com/pennersr/django-allauth/tree/master/allauth/templates/account/email

Then you should be able to edit them.

I tried copying everything into the templates folder, then I edit the "email_confirmation_signup_subject.txt", also tried "email_confirmation_subject.txt" and nothing is happening.
It seems like it's still grabbing the default from Allauth instead of my template.

It seems to work fine when I add the "email_confirmation_signup_message.html" template but not for the subject.

@MatheusADias
Copy link

I have the same problem... is there some update?

@9mido
Copy link
Contributor

9mido commented Aug 13, 2021

IIRC it really depends on your project's settings.py for BASE_DIR and TEMPLATES settings. You need to tell your django settings to point to the templates folder inside of your project's directory and do not point to your virtual environment directory where all of your pip packages go.

Here is an example:

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR,"templates")],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

This is where allauth templates get overridden:
/home/name/project-name/templates/account/

This is where project related apps live:
/home/name/project-name/app1
/home/name/project-name/app2

This is where settings for the project lives:
/home/name/project-name/settings-folder/settings.py

Otherwise, try going to your virtual environment directory and edit django-allauth directly where django-allauth was installed. It depends on what operating system you use the path of your installed pip packages.

But maybe we should avoid overriding altogether and make it easy for people to change the subject directly from an allauth setting.

@pennersr
Copy link
Owner

Closing -- unlikely an issue in allauth. Take care of Django's template loading order, that might explain things.

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

No branches or pull requests

4 participants