Update email context
This commit is contained in:
parent
df5fc71aca
commit
2bd6e02fa1
|
|
@ -89,6 +89,22 @@ class DatatransWebhookTestCase(APITestCase):
|
||||||
state=CheckoutState.ONGOING,
|
state=CheckoutState.ONGOING,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
checkout_info = CheckoutInformation.objects.get(transaction_id=transaction_id)
|
||||||
|
checkout_info.first_name = "Max"
|
||||||
|
checkout_info.last_name = "Mustermann"
|
||||||
|
checkout_info.street = "Musterstrasse"
|
||||||
|
checkout_info.street_number = "1"
|
||||||
|
checkout_info.postal_code = "1234"
|
||||||
|
checkout_info.city = "Musterstadt"
|
||||||
|
checkout_info.country = "Schweiz"
|
||||||
|
checkout_info.company_name = "Musterfirma"
|
||||||
|
checkout_info.company_street = "Firmastrasse"
|
||||||
|
checkout_info.company_street_number = "2"
|
||||||
|
checkout_info.company_postal_code = "5678"
|
||||||
|
checkout_info.company_city = "Firmastadt"
|
||||||
|
checkout_info.company_country = "Schweiz"
|
||||||
|
checkout_info.save()
|
||||||
|
|
||||||
mock_is_signature_valid.return_value = True
|
mock_is_signature_valid.return_value = True
|
||||||
|
|
||||||
# WHEN
|
# WHEN
|
||||||
|
|
@ -148,8 +164,14 @@ class DatatransWebhookTestCase(APITestCase):
|
||||||
template=EmailTemplate.WELCOME_MAIL_VV,
|
template=EmailTemplate.WELCOME_MAIL_VV,
|
||||||
recipient_email=self.user.email,
|
recipient_email=self.user.email,
|
||||||
template_data={
|
template_data={
|
||||||
"course": "Versicherungsvermittler/-in (Deutsch)",
|
"course": "Versicherungsvermittler/-in VBV (Deutsch)",
|
||||||
"target_url": "https://my.vbv-afa.ch/",
|
"target_url": "https://my.vbv-afa.ch/",
|
||||||
|
"name": "Max Mustermann",
|
||||||
|
"private_street": "Musterstrasse 1",
|
||||||
|
"private_city": "1234 Musterstadt Schweiz",
|
||||||
|
"company_name": "Musterfirma",
|
||||||
|
"company_street": "Firmastrasse 2",
|
||||||
|
"company_city": "5678 Firmastadt Schweiz",
|
||||||
},
|
},
|
||||||
template_language=self.user.language,
|
template_language=self.user.language,
|
||||||
fail_silently=ANY,
|
fail_silently=ANY,
|
||||||
|
|
|
||||||
|
|
@ -197,9 +197,9 @@ def update_checkout_state(checkout_info: CheckoutInformation, state: CheckoutSta
|
||||||
|
|
||||||
def send_vv_welcome_email(checkout_info: CheckoutInformation):
|
def send_vv_welcome_email(checkout_info: CheckoutInformation):
|
||||||
course_names = {
|
course_names = {
|
||||||
VV_DE_PRODUCT_SKU: "Versicherungsvermittler/-in (Deutsch)",
|
VV_DE_PRODUCT_SKU: "Versicherungsvermittler/-in VBV (Deutsch)",
|
||||||
VV_FR_PRODUCT_SKU: "Intermédiaire d’assurance (Français)",
|
VV_FR_PRODUCT_SKU: "Intermédiaire d’assurance AFA (Français)",
|
||||||
VV_IT_PRODUCT_SKU: "Intermediario/a assicurativo/a (Italiano)",
|
VV_IT_PRODUCT_SKU: "Intermediario/a assicurativo/a AFA (Italiano)",
|
||||||
}
|
}
|
||||||
|
|
||||||
send_email(
|
send_email(
|
||||||
|
|
@ -208,8 +208,15 @@ def send_vv_welcome_email(checkout_info: CheckoutInformation):
|
||||||
template_data={
|
template_data={
|
||||||
"course": course_names[checkout_info.product_sku],
|
"course": course_names[checkout_info.product_sku],
|
||||||
"target_url": "https://my.vbv-afa.ch/",
|
"target_url": "https://my.vbv-afa.ch/",
|
||||||
|
"name": f"{checkout_info.first_name} {checkout_info.last_name}",
|
||||||
|
"private_street": f"{checkout_info.street} {checkout_info.street_number}",
|
||||||
|
"private_city": f"{checkout_info.postal_code} {checkout_info.city} {checkout_info.country}",
|
||||||
|
"company_name": checkout_info.company_name,
|
||||||
|
"company_street": f"{checkout_info.company_street} {checkout_info.company_street_number}",
|
||||||
|
"company_city": f"{checkout_info.company_postal_code} {checkout_info.company_city} {checkout_info.company_country}",
|
||||||
},
|
},
|
||||||
template_language=checkout_info.user.language,
|
# template_language=checkout_info.user.language,
|
||||||
|
template_language="de",
|
||||||
fail_silently=True,
|
fail_silently=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue