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

Issue 3 #16

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from
Open

Issue 3 #16

wants to merge 28 commits into from

Conversation

Joaquinecc
Copy link
Collaborator

@Joaquinecc Joaquinecc commented Mar 28, 2021

Funcionalidades:
Cuando se ingresa un nuevo usuario, se lo notifica a los moderadores via email. Mediante la variable EMAILS_FROM_MODERATOR se obtiene los mails de los moderadores.
Cuando se aprueva un nuevo registro de usuario via el administrador de django, se le notifica al usuario via email.

Key Variables
EMAILS_FROM_MODERATOR = to email of all moderator
DEFAULT_FROM_EMAIL = from email
EMAIL_HOST_PASSWORD = app password of the email host
(Mirar .env.dev.sample)

New tools
Para poder enviar los emails de manera asincrona se utilizaron rabbitmq(broker) y celery.

@Joaquinecc Joaquinecc requested a review from joausaga March 28, 2021 01:23
app/email.py Outdated Show resolved Hide resolved
app/email.py Outdated Show resolved Hide resolved
app/forms.py Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
app/admin.py Outdated Show resolved Hide resolved
app/admin.py Outdated Show resolved Hide resolved
app/admin.py Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
templates/index.html Outdated Show resolved Hide resolved
@joausaga
Copy link
Owner

joausaga commented Mar 29, 2021

@Joaquinecc vamos a usar template html en lugar txt para el email a los nuevos registrados eso nos daría la posibilidad de agregar texto con formato, enlaces, imágenes, etc. Acá podes ver un ejemplo https://github.com/joausaga/social-ideation/blob/master/app/templates/app/email/email_invitation_join_group.html

@joausaga
Copy link
Owner

joausaga commented Mar 29, 2021

Texto para email de notificación de nuevo registro.

Hola!

[Nombre de la persona] afiliado a [Nombre institución] en calidad de [Nombre de posición] desea registrarse en la plataforma Investigadores Paraguayos en el Mundo.

Favor ingrese al panel de administración para aprobar el registro.

Gracias

@joausaga
Copy link
Owner

Texto para email a nuevos registrados luego de aprobación

[banner con imagen del sitio]

Hola [nombre del registrado] (solo nombre no apellido),

Tu registro en el sitio Investigadores Paraguayos en el Mundo ha sido aprobado. Puedes verificar tu información en el sitio accediendo al mapa aquí.

Puedes modificar datos de tu registro [aquí]([enlace a formulario de edicion]).

Recuerda que la del sitio es:

  1. Generar colaboraciones entre académicos paraguayos residiendo en el extranjero y trabajando en áreas afines con el potencial de iniciar lineas de investigación que puedan derivar en investigaciones conjuntas en el futuro;
  2. Fortalecer vínculos entre investigadores paraguayos residiendo en lugares próximos lo que propiciará la creación de comunidades locales para el intercambio de ideas, conocimientos, y experiencias.

Por lo que te animo a aprovechar la información del sitio para entrar establecer contacto y colaboración que puedan ayudarte en tus actividades académicas.

Cualquier otra cosa, estoy a las órdenes.

Saludos!

Jorge Saldivar Galli

@joausaga
Copy link
Owner

joausaga commented Mar 29, 2021

Un banner que podemos usar es este

Screenshot 2021-03-29 at 18 13 43

.env.dev.sample Outdated Show resolved Hide resolved
.env.dev.sample Outdated Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
README.md Outdated
@@ -4,8 +4,6 @@ abroad and working in academia. The website shows the name, field of expertise,
(i.e., PhD student, postdoc, professor), and location of Paraguayans who are residing and doing
academic research in universities, research centers, and companies abroad.

A live version of CIPE can be accessed [here](https://investigadoresparaguayosenelmundo.com/).
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Por que se borra esto?

app/forms.py Outdated Show resolved Hide resolved
app/forms.py Show resolved Hide resolved
<br><br>
Puedes modificar datos de tu registro <a href="https://investigadoresparaguayosenelmundo.com/registration/edit/{{ slug }}">aqui</a>.
<br><br>
Recuerda que la del sitio es:
Copy link
Owner

@joausaga joausaga Apr 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Falta algo en la oración, deberia ser Recuerda que el objetivo del sitio es

app/templates/email/approved_email.html Outdated Show resolved Hide resolved
app/templates/email/approved_email.html Outdated Show resolved Hide resolved
.env.dev.sample Outdated Show resolved Hide resolved
.env.dev.sample Outdated
RABBITMQ_DEFAULT_USER=guest
RABBITMQ_DEFAULT_PASS=guest
CELERY_BROKER_URL=amqp://${RABBITMQ_DEFAULT_USER}:${RABBITMQ_DEFAULT_PASS}@rabbit:5672/%2F
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

El url del celery broker no debería estar aquí

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aquí me refiero a que solo los parámetros de la URL deberían estar en el archivo de configuración (RABBITMQ_DEFAULT_USER y RABBITMQ_DEFAULT_PASS) el resto debe ir al archivo docker donde se define el servicio. También, si 5672 es un número de puerto, eso no debe estar hard codeado debe ser una variable

Dockerfile Show resolved Hide resolved
README.md Show resolved Hide resolved
@@ -54,10 +55,26 @@ def affiliation(self, obj):
except:
return ''
affiliation.short_description = 'Affiliation'
def save_model(self, request, obj, form, change):
if(change):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

De donde sale la variable change?

app/email.py Show resolved Hide resolved
app/templates/email/approved_email.html Outdated Show resolved Hide resolved
app/templates/email/approved_email.html Outdated Show resolved Hide resolved
app/templates/email/approved_email.html Outdated Show resolved Hide resolved
README.md Outdated
4. Run `scripts/prepare-config-templates.sh`
5. Set the configuration parameters of the database in `.env.prod.db`;
6. Set the SECRET_KEY and GOOGLE_MAPS_API_KEY obtained before as well as the configuration parameters
of the database in `.env.prod`;
7. Build docker container `docker-compose -f docker-compose.prod.yml up --build -d` ,
Once containers are fully created, you can watch the logs with `docker-compose -f docker-compose.prod.yml logs -f` , to see for the containers to be fully initialized;
8. Load initial data `docker-compose -f docker-compose.prod.yml exec app python manage.py loaddata data/initial_data.json`;
8. Load initial data `docker-compose exec -f docker-compose.prod.yml app python manage.py loaddata data/initial_data.json`;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Esto no es correcto, el exec tiene que ir después de docker-compose.prod.yml. Tal como estaba antes

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

Successfully merging this pull request may close these issues.

2 participants