diff --git a/config/__pycache__/settings.cpython-311.pyc b/config/__pycache__/settings.cpython-311.pyc index 80f84c6..e585aeb 100644 Binary files a/config/__pycache__/settings.cpython-311.pyc and b/config/__pycache__/settings.cpython-311.pyc differ diff --git a/config/settings.py b/config/settings.py index ad444c4..b13472c 100644 --- a/config/settings.py +++ b/config/settings.py @@ -165,15 +165,16 @@ MEDIA_ROOT = BASE_DIR / 'media' # Email EMAIL_BACKEND = os.getenv( "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_HOST_USER = os.getenv("EMAIL_HOST_USER", "") -EMAIL_HOST_PASSWORD = os.getenv("EMAIL_HOST_PASSWORD", "") +EMAIL_HOST_USER = os.getenv("EMAIL_HOST_USER", "konrad@foxfitt.co.za") +EMAIL_HOST_PASSWORD = os.getenv("EMAIL_HOST_PASSWORD", "cwvhpcwyijneukax") EMAIL_USE_TLS = os.getenv("EMAIL_USE_TLS", "true").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 = [ item.strip() for item in os.getenv("CONTACT_EMAIL_TO", DEFAULT_FROM_EMAIL).split(",") @@ -191,4 +192,4 @@ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' # Authentication LOGIN_URL = 'login' LOGIN_REDIRECT_URL = 'home' -LOGOUT_REDIRECT_URL = 'login' +LOGOUT_REDIRECT_URL = 'login' \ No newline at end of file diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index af46955..2ec5074 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/views.py b/core/views.py index db1a3f8..9c0cc92 100644 --- a/core/views.py +++ b/core/views.py @@ -607,7 +607,7 @@ def process_payment(request, worker_id): # 2. Render PDF Attachment 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: # Construct Email with Attachment @@ -790,7 +790,7 @@ def create_receipt(request): # Email Generation subject = f"Receipt from {receipt.vendor} - {receipt.date}" - recipient_list = ['foxfitt-ed9wc+expense@to.sparkreceipt.com'] + recipient_list = [settings.SPARK_RECEIPT_EMAIL] # Prepare Context context = { @@ -831,4 +831,4 @@ def create_receipt(request): return render(request, 'core/create_receipt.html', { 'form': form, 'items': items - }) \ No newline at end of file + })