ver 11 fixed spark send
This commit is contained in:
parent
0702dcda68
commit
9c365aa4e1
Binary file not shown.
@ -165,15 +165,16 @@ MEDIA_ROOT = BASE_DIR / 'media'
|
|||||||
# Email
|
# Email
|
||||||
EMAIL_BACKEND = os.getenv(
|
EMAIL_BACKEND = os.getenv(
|
||||||
"EMAIL_BACKEND",
|
"EMAIL_BACKEND",
|
||||||
"django.core.mail.backends.console.EmailBackend"
|
"django.core.mail.backends.smtp.EmailBackend"
|
||||||
)
|
)
|
||||||
EMAIL_HOST = os.getenv("EMAIL_HOST", "127.0.0.1")
|
EMAIL_HOST = os.getenv("EMAIL_HOST", "smtp.gmail.com")
|
||||||
EMAIL_PORT = int(os.getenv("EMAIL_PORT", "587"))
|
EMAIL_PORT = int(os.getenv("EMAIL_PORT", "587"))
|
||||||
EMAIL_HOST_USER = os.getenv("EMAIL_HOST_USER", "")
|
EMAIL_HOST_USER = os.getenv("EMAIL_HOST_USER", "konrad@foxfitt.co.za")
|
||||||
EMAIL_HOST_PASSWORD = os.getenv("EMAIL_HOST_PASSWORD", "")
|
EMAIL_HOST_PASSWORD = os.getenv("EMAIL_HOST_PASSWORD", "cwvhpcwyijneukax")
|
||||||
EMAIL_USE_TLS = os.getenv("EMAIL_USE_TLS", "true").lower() == "true"
|
EMAIL_USE_TLS = os.getenv("EMAIL_USE_TLS", "true").lower() == "true"
|
||||||
EMAIL_USE_SSL = os.getenv("EMAIL_USE_SSL", "false").lower() == "true"
|
EMAIL_USE_SSL = os.getenv("EMAIL_USE_SSL", "false").lower() == "true"
|
||||||
DEFAULT_FROM_EMAIL = os.getenv("DEFAULT_FROM_EMAIL", "no-reply@example.com")
|
DEFAULT_FROM_EMAIL = os.getenv("DEFAULT_FROM_EMAIL", "konrad+foxlog@foxfitt.co.za")
|
||||||
|
SPARK_RECEIPT_EMAIL = os.getenv("SPARK_RECEIPT_EMAIL", "foxfitt-ed9wc+expense@to.sparkreceipt.com")
|
||||||
CONTACT_EMAIL_TO = [
|
CONTACT_EMAIL_TO = [
|
||||||
item.strip()
|
item.strip()
|
||||||
for item in os.getenv("CONTACT_EMAIL_TO", DEFAULT_FROM_EMAIL).split(",")
|
for item in os.getenv("CONTACT_EMAIL_TO", DEFAULT_FROM_EMAIL).split(",")
|
||||||
|
|||||||
Binary file not shown.
@ -607,7 +607,7 @@ def process_payment(request, worker_id):
|
|||||||
# 2. Render PDF Attachment
|
# 2. Render PDF Attachment
|
||||||
pdf_content = render_to_pdf('core/pdf/payslip_pdf.html', context)
|
pdf_content = render_to_pdf('core/pdf/payslip_pdf.html', context)
|
||||||
|
|
||||||
recipient_list = ['foxfitt-ed9wc+expense@to.sparkreceipt.com']
|
recipient_list = [settings.SPARK_RECEIPT_EMAIL]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Construct Email with Attachment
|
# Construct Email with Attachment
|
||||||
@ -790,7 +790,7 @@ def create_receipt(request):
|
|||||||
|
|
||||||
# Email Generation
|
# Email Generation
|
||||||
subject = f"Receipt from {receipt.vendor} - {receipt.date}"
|
subject = f"Receipt from {receipt.vendor} - {receipt.date}"
|
||||||
recipient_list = ['foxfitt-ed9wc+expense@to.sparkreceipt.com']
|
recipient_list = [settings.SPARK_RECEIPT_EMAIL]
|
||||||
|
|
||||||
# Prepare Context
|
# Prepare Context
|
||||||
context = {
|
context = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user