Improve syntax email
This commit is contained in:
parent
36f1d2e6ea
commit
bd3b934853
@ -132,8 +132,8 @@ MEDIA_URL = '/media/'
|
|||||||
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
||||||
|
|
||||||
# Incoming Email
|
# Incoming Email
|
||||||
E_NOREPLAY = 'noreply@example.com'
|
EMAIL_FROM = 'noreply@example.com'
|
||||||
E_INCOMING = 'user@example.com'
|
EMAIL_TO = 'user@example.com'
|
||||||
|
|
||||||
# Email config
|
# Email config
|
||||||
EMAIL_HOST = 'smtp.example.com'
|
EMAIL_HOST = 'smtp.example.com'
|
||||||
|
@ -4,8 +4,8 @@ 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 (
|
from personalsite.settings import (
|
||||||
E_INCOMING,
|
EMAIL_FROM,
|
||||||
E_NOREPLAY
|
EMAIL_TO
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -24,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),
|
||||||
E_NOREPLAY,
|
EMAIL_FROM,
|
||||||
[E_INCOMING],
|
[EMAIL_TO],
|
||||||
reply_to=[email],
|
reply_to=[email],
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user