Fixed emails
This commit is contained in:
@@ -52,6 +52,15 @@ SIMPLE_JWT = {
|
|||||||
|
|
||||||
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
||||||
|
|
||||||
|
# For testing emails
|
||||||
|
# https://medium.com/@_christopher/how-to-send-emails-with-python-django-through-google-smtp-server-for-free-22ea6ea0fb8e
|
||||||
|
# EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
||||||
|
# EMAIL_HOST = 'smtp.gmail.com'
|
||||||
|
# EMAIL_USE_TLS = True
|
||||||
|
# EMAIL_PORT = 587
|
||||||
|
# EMAIL_HOST_USER = '' # your email account
|
||||||
|
# EMAIL_HOST_PASSWORD = '' #your password
|
||||||
|
|
||||||
# disable web interface for REST backend
|
# disable web interface for REST backend
|
||||||
|
|
||||||
# REST_FRAMEWORK['DEFAULT_RENDERER_CLASSES'] = ('rest_framework.renderers.JSONRenderer',)
|
# REST_FRAMEWORK['DEFAULT_RENDERER_CLASSES'] = ('rest_framework.renderers.JSONRenderer',)
|
||||||
|
|||||||
@@ -71,12 +71,13 @@ def create_admin_user(email, password):
|
|||||||
def send_verification_email(request, user):
|
def send_verification_email(request, user):
|
||||||
try:
|
try:
|
||||||
current_site = get_current_site(request)
|
current_site = get_current_site(request)
|
||||||
|
uid = urlsafe_base64_encode(force_bytes(user.pk))
|
||||||
|
token = account_activation_token.make_token(user)
|
||||||
|
verification_url = 'https://' + current_site.domain + '/activate/' + uid + '/' + token
|
||||||
subject = 'Activa Tu Cuenta'
|
subject = 'Activa Tu Cuenta'
|
||||||
message = render_to_string('email_verification.html', {
|
message = render_to_string('email_verification.html', {
|
||||||
'user': user,
|
'user': user,
|
||||||
'domain': current_site.domain,
|
'verification_url': verification_url
|
||||||
'uid': urlsafe_base64_encode(force_bytes(user.pk)),
|
|
||||||
'token': account_activation_token.make_token(user),
|
|
||||||
})
|
})
|
||||||
email = EmailMessage(
|
email = EmailMessage(
|
||||||
subject, message, to=[user.email]
|
subject, message, to=[user.email]
|
||||||
|
|||||||
@@ -209,7 +209,7 @@
|
|||||||
height="auto"
|
height="auto"
|
||||||
width="25"
|
width="25"
|
||||||
align="left"
|
align="left"
|
||||||
src="https://latienda.coop/_nuxt/img/latienda-logo.3e53761.svg"
|
src="https://latienda.coop/_nuxt/img/latienda-logo.dea6549.png"
|
||||||
style="
|
style="
|
||||||
border: none;
|
border: none;
|
||||||
display: block;
|
display: block;
|
||||||
@@ -485,12 +485,12 @@
|
|||||||
"
|
"
|
||||||
>
|
>
|
||||||
Hola {{ user.full_name }},
|
Hola {{ user.full_name }},
|
||||||
<br />
|
<br /><br />
|
||||||
Por favor, verifica tu
|
Por favor, verifica tu
|
||||||
registro en LaTiendaCOOP
|
registro en LaTiendaCOOP
|
||||||
haciendo click <a href="https://{{ domain }}{% url
|
haciendo click en el siguiente enlace:
|
||||||
'activate_user' uidb64=uid
|
<br/> <br />
|
||||||
token=token %}">AQUÍ</a>
|
<a href="{{verification_url}}">{{verification_url}}</a>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -430,21 +430,11 @@
|
|||||||
href="https://latienda.coop/productos/{{product.id}}"
|
href="https://latienda.coop/productos/{{product.id}}"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
|
{% if product.image %}
|
||||||
<img
|
<img
|
||||||
alt=""
|
alt=""
|
||||||
height="auto"
|
height="auto"
|
||||||
{%
|
|
||||||
if
|
|
||||||
product.image
|
|
||||||
%}
|
|
||||||
src="{{product.image.url}}"
|
src="{{product.image.url}}"
|
||||||
{%
|
|
||||||
else
|
|
||||||
%}
|
|
||||||
src="https://latienda.coop/_nuxt/img/latienda-product-default.0b2c2e0.svg"
|
|
||||||
{%
|
|
||||||
endif
|
|
||||||
%}
|
|
||||||
style="
|
style="
|
||||||
border: none;
|
border: none;
|
||||||
display: block;
|
display: block;
|
||||||
@@ -456,6 +446,23 @@
|
|||||||
"
|
"
|
||||||
width="250"
|
width="250"
|
||||||
/>
|
/>
|
||||||
|
{% else %}
|
||||||
|
<img
|
||||||
|
alt=""
|
||||||
|
height="auto"
|
||||||
|
src="https://latienda.coop/_nuxt/img/latienda-product-default.772863e.png"
|
||||||
|
style="
|
||||||
|
border: none;
|
||||||
|
display: block;
|
||||||
|
outline: none;
|
||||||
|
text-decoration: none;
|
||||||
|
height: auto;
|
||||||
|
width: 100%;
|
||||||
|
font-size: 13px;
|
||||||
|
"
|
||||||
|
width="250"
|
||||||
|
/>
|
||||||
|
{% endif %}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -729,18 +736,28 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{company.shop_link}}" target="_blank">
|
<a href="{{company.shop_link}}" target="_blank">
|
||||||
|
{% if company.logo %}
|
||||||
<img
|
<img
|
||||||
alt="logo cooperativa"
|
alt="logo cooperativa"
|
||||||
height="auto"
|
height="auto"
|
||||||
{%
|
|
||||||
if
|
|
||||||
company.logo
|
|
||||||
%}
|
|
||||||
src="{{company.logo.url}}"
|
src="{{company.logo.url}}"
|
||||||
{%
|
style="
|
||||||
else
|
border: none;
|
||||||
%}
|
display: block;
|
||||||
src="https://latienda.coop/_nuxt/img/latienda-product-default.0b2c2e0.svg"
|
outline: none;
|
||||||
|
text-decoration: none;
|
||||||
|
height: auto;
|
||||||
|
width: 50%;
|
||||||
|
font-size: 13px;
|
||||||
|
padding-top: 20px;
|
||||||
|
margin: auto;
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
{% else %}
|
||||||
|
<img
|
||||||
|
alt="logo cooperativa"
|
||||||
|
height="auto"
|
||||||
|
src="https://latienda.coop/_nuxt/img/latienda-product-default.772863e.png"
|
||||||
{%
|
{%
|
||||||
endif
|
endif
|
||||||
%}
|
%}
|
||||||
@@ -756,6 +773,7 @@
|
|||||||
margin: auto;
|
margin: auto;
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
|
{% endif %}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -426,21 +426,11 @@
|
|||||||
href="https://latienda.coop/productos/{{product.id}}"
|
href="https://latienda.coop/productos/{{product.id}}"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
|
{% if product.image %}
|
||||||
<img
|
<img
|
||||||
alt=""
|
alt=""
|
||||||
height="auto"
|
height="auto"
|
||||||
{%
|
|
||||||
if
|
|
||||||
product.image
|
|
||||||
%}
|
|
||||||
src="{{product.image.url}}"
|
src="{{product.image.url}}"
|
||||||
{%
|
|
||||||
else
|
|
||||||
%}
|
|
||||||
src="https://latienda.coop/_nuxt/img/latienda-product-default.0b2c2e0.svg"
|
|
||||||
{%
|
|
||||||
endif
|
|
||||||
%}
|
|
||||||
style="
|
style="
|
||||||
border: none;
|
border: none;
|
||||||
display: block;
|
display: block;
|
||||||
@@ -452,6 +442,23 @@
|
|||||||
"
|
"
|
||||||
width="250"
|
width="250"
|
||||||
/>
|
/>
|
||||||
|
{% else %}
|
||||||
|
<img
|
||||||
|
alt=""
|
||||||
|
height="auto"
|
||||||
|
src="https://latienda.coop/_nuxt/img/latienda-product-default.772863e.png"
|
||||||
|
style="
|
||||||
|
border: none;
|
||||||
|
display: block;
|
||||||
|
outline: none;
|
||||||
|
text-decoration: none;
|
||||||
|
height: auto;
|
||||||
|
width: 100%;
|
||||||
|
font-size: 13px;
|
||||||
|
"
|
||||||
|
width="250"
|
||||||
|
/>
|
||||||
|
{% endif %}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -941,7 +948,7 @@
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style="
|
style="
|
||||||
font-family: Poppins;
|
font-family: Poppins, Arial, sans-serif;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|||||||
Reference in New Issue
Block a user