Skip to content

Commit d8fd9aa

Browse files
committed
version 1.0.3-snapshot
1 parent 61f5639 commit d8fd9aa

File tree

8 files changed

+21
-19
lines changed

8 files changed

+21
-19
lines changed

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
include LICENSE
22
include README.md
3-
recursive-include appointment/migrations *.py
43
recursive-include appointment/templates/appointment *.html
54
recursive-include appointment/templates/base_templates *.html
65
recursive-include appointment/templates/email_sender *.html
76
recursive-include appointment/static/css *.css
87
recursive-include appointment/static/js *.js
8+
recursive-include appointment/email_sender *.py
99
recursive-include appointment *.py
1010
recursive-include docs *

appointment/email_messages.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
thank_you_no_payment = f"We're excited to have you on board! Thank you for booking us. " \
2+
f"We hope you enjoy using our services and find them valuable."
3+
thank_you_payment = f"We're excited to have you on board! Thank you for booking us. The next step is to pay for " \
4+
f"the booking. You have the choice to pay the whole amount or a down deposit. " \
5+
f"If you choose the deposit, you will have to pay the rest of the amount on the day of the booking."
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .email_sender import send_email, notify_admin
File renamed without changes.

appointment/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,4 +271,7 @@ def get_img_url(self):
271271
def set_paid_status(self, status: bool):
272272
self.appointment.set_appointment_paid_status(status)
273273

274+
def get_user(self):
275+
return self.appointment.get_client()
276+
274277

appointment/templates/email_sender/thank_you_email.html

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,7 @@ <h1>{% trans "Your booking session request has been accepted" %}!</h1>
5353
<div class="content">
5454
<p>{% trans "Hello" %} {{ first_name }},</p>
5555
<p>
56-
{% if not payment %}
57-
{% blocktranslate %}
58-
We're excited to have you on board! Thank you for booking us. We hope you enjoy using our services
59-
and find them valuable.
60-
{% endblocktranslate %}
61-
{% else %}
62-
{% blocktranslate %}
63-
We're excited to have you on board! Thank you for booking us. The next step is to pay for the
64-
booking. You have the choice to pay the whole amount or a ${{ deposit }} down deposit. If you choose
65-
the deposit, you will have to pay the rest of the amount on the day of the booking.
66-
{% endblocktranslate %}
67-
{% endif %}
56+
{{ message }}
6857
</p>
6958
<p>
7059
{% blocktranslate %}

appointment/views.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
from appointment.forms import AppointmentRequestForm
1414
from appointment.models import Service, Appointment, AppointmentRequest, PaymentInfo
1515
from appointment.utils import Utility
16-
from email_sender.email_sender import send_email
16+
from appointment.email_sender import send_email
17+
from . import email_messages
1718
from .settings import (APPOINTMENT_CLIENT_MODEL, APPOINTMENT_BASE_TEMPLATE, APPOINTMENT_WEBSITE_NAME,
1819
APPOINTMENT_PAYMENT_URL, APPOINTMENT_THANK_YOU_URL)
1920

@@ -152,13 +153,16 @@ def appointment_client_information(request, appointment_request_id, id_request):
152153
user.save()
153154

154155
# Email the user
156+
message = email_messages.thank_you_no_payment if APPOINTMENT_PAYMENT_URL is None else email_messages.thank_you_payment
157+
email_context = {
158+
'first_name': user.first_name,
159+
'message': message,
160+
'current_year': datetime.datetime.now().year,
161+
'company': APPOINTMENT_WEBSITE_NAME
162+
}
155163
send_email(
156164
recipient_list=[client_data['email']], subject="Thank you for booking us.",
157-
template_url='email_sender/thank_you_email.html', context={'first_name': user.first_name,
158-
'current_year': datetime.datetime.now().year,
159-
'company': APPOINTMENT_WEBSITE_NAME,
160-
'payment': APPOINTMENT_PAYMENT_URL is not None,
161-
'deposit': ar.get_service_down_payment()},
165+
template_url='email_sender/thank_you_email.html', context=email_context
162166
)
163167
messages.success(request, _("An account was created for you."))
164168

email_sender/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)