improve email inbox
This commit is contained in:
parent
0a06bf8a5d
commit
36f1d2e6ea
@ -131,6 +131,10 @@ MEDIA_ROOT = os.path.join(BASE_DIR, 'core/static')
|
|||||||
MEDIA_URL = '/media/'
|
MEDIA_URL = '/media/'
|
||||||
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
||||||
|
|
||||||
|
# Incoming Email
|
||||||
|
E_NOREPLAY = 'noreply@example.com'
|
||||||
|
E_INCOMING = 'user@example.com'
|
||||||
|
|
||||||
# Email config
|
# Email config
|
||||||
EMAIL_HOST = 'smtp.example.com'
|
EMAIL_HOST = 'smtp.example.com'
|
||||||
EMAIL_HOST_USER = 'username'
|
EMAIL_HOST_USER = 'username'
|
||||||
|
@ -3,6 +3,10 @@ from django.urls import reverse
|
|||||||
from django.core.mail import EmailMessage
|
from django.core.mail import EmailMessage
|
||||||
from .models import Project
|
from .models import Project
|
||||||
from .forms import ContactForm
|
from .forms import ContactForm
|
||||||
|
from personalsite.settings import (
|
||||||
|
E_INCOMING,
|
||||||
|
E_NOREPLAY
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def home(request):
|
def home(request):
|
||||||
@ -20,8 +24,8 @@ def home(request):
|
|||||||
msg = EmailMessage(
|
msg = EmailMessage(
|
||||||
"Personal-Site: Nuevo mensaje",
|
"Personal-Site: Nuevo mensaje",
|
||||||
"De {} <{}>\n\nEscribió:\n\n{}".format(name, email, content),
|
"De {} <{}>\n\nEscribió:\n\n{}".format(name, email, content),
|
||||||
"noreply@heckyel.ga",
|
E_NOREPLAY,
|
||||||
["heckyel@riseup.net"],
|
[E_INCOMING],
|
||||||
reply_to=[email],
|
reply_to=[email],
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user