update
This commit is contained in:
@@ -101,6 +101,8 @@ def send_contact_submission_notification(submission):
|
||||
# Prepare email context
|
||||
context = {
|
||||
'submission': submission,
|
||||
'logo_url': f'{settings.SITE_URL}/images/logo.png',
|
||||
'site_url': settings.SITE_URL,
|
||||
}
|
||||
|
||||
# Render email templates
|
||||
@@ -170,45 +172,36 @@ def send_contact_submission_confirmation(submission):
|
||||
# Prepare email context
|
||||
context = {
|
||||
'submission': submission,
|
||||
'logo_url': f'{settings.SITE_URL}/images/logo.png',
|
||||
'site_url': settings.SITE_URL,
|
||||
}
|
||||
|
||||
# Create simple confirmation email
|
||||
# Create confirmation email
|
||||
subject = "Thank you for contacting GNX Software Solutions"
|
||||
|
||||
# Simple text email for confirmation
|
||||
message = f"""
|
||||
Dear {submission.full_name},
|
||||
|
||||
Thank you for reaching out to GNX Software Solutions!
|
||||
|
||||
We have received your inquiry about {submission.get_project_type_display() if submission.project_type else 'your project'} and will review it carefully.
|
||||
|
||||
Here are the details of your submission:
|
||||
- Submission ID: #{submission.id}
|
||||
- Company: {submission.company}
|
||||
- Project Type: {submission.get_project_type_display() if submission.project_type else 'Not specified'}
|
||||
- Timeline: {submission.get_timeline_display() if submission.timeline else 'Not specified'}
|
||||
|
||||
Our team will contact you within 24 hours to discuss your project requirements and how we can help you achieve your goals.
|
||||
|
||||
If you have any urgent questions, please don't hesitate to contact us directly.
|
||||
|
||||
Best regards,
|
||||
The GNX Team
|
||||
|
||||
---
|
||||
GNX Software Solutions
|
||||
Email: {settings.DEFAULT_FROM_EMAIL}
|
||||
"""
|
||||
# Render HTML email template
|
||||
html_content = render_to_string(
|
||||
'contact/contact_submission_confirmation.html',
|
||||
context
|
||||
)
|
||||
|
||||
# Render text email template
|
||||
text_content = render_to_string(
|
||||
'contact/contact_submission_confirmation.txt',
|
||||
context
|
||||
)
|
||||
|
||||
# Create email message
|
||||
email = EmailMultiAlternatives(
|
||||
subject=subject,
|
||||
body=message,
|
||||
body=text_content,
|
||||
from_email=settings.DEFAULT_FROM_EMAIL,
|
||||
to=[submission.email]
|
||||
)
|
||||
|
||||
# Attach HTML version
|
||||
email.attach_alternative(html_content, "text/html")
|
||||
|
||||
# Send email with retry logic
|
||||
success = _send_email_with_retry(email)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user