Admin email notification when a new user registers in GeoNode #14181
Unanswered
Slouis-afk
asked this question in
Q&A
Replies: 1 comment
|
The env missing in this case is: ACCOUNT_APPROVAL_REQUIRED as stated: can you try with that? the system should work automatically without the need to manually force the email send |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello everyone,
I am trying to build a GeoNode (version 5) for production. My GeoNode runs in Docker, which I installed according to the official guide on the website.
One feature I would like is the following: when someone registers, the admin should receive an email so they can log into GeoNode and activate the user profile.
From what I understand, this feature already exists in GeoNode, but it does not seem to work for me. When I check the logs (Django and Celery), nothing happens when I register a new user.
The first strange thing happens here:
/admin/pinax_notifications/noticesetting/When I tick the "Sending" box, I get an error saying that the field where I put
"email"is not a valid medium (with the message: "Choose a valid choice, 0 is not").I think that in my
.envfile everything is correctly configured:EMAIL Notifications
EMAIL_ENABLE=True
DJANGO_EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend
DJANGO_EMAIL_HOST=****************
DJANGO_EMAIL_PORT=***********
DJANGO_EMAIL_HOST_USER=****
DJANGO_EMAIL_HOST_PASSWORD=***
DJANGO_EMAIL_USE_TLS=False
DJANGO_EMAIL_USE_SSL=True
DEFAULT_FROM_EMAIL=*********
When I try to send an email through the Docker container, it works:
docker compose exec django python manage.py shell -c "
from django.contrib.auth import get_user_model
from pinax.notifications.backends.email import EmailBackend
from pinax.notifications.models import NoticeType
User = get_user_model()
admin = User.objects.get(username='admin')
notice_type = NoticeType.objects.get(label='account_approve')
backend = EmailBackend('2')
try:
backend.deliver(admin, admin, notice_type, {})
print('Email sent successfully!')
except Exception as e:
print('Error:', type(e).name, str(e))
"
However, when a user registers, it seems that nothing is triggered and I do not receive any email.
Does anyone have an idea what could be missing or misconfigured?
Thanks in advance for any help!
All reactions