third voucher

main
alex 2024-05-05 10:24:34 +02:00
parent dcddfd9b24
commit 24f0ee76c3
4 changed files with 186 additions and 160 deletions

View File

@ -8,25 +8,31 @@
rel="stylesheet"
href="../../groupsData/shx-order-voucher-codes/backPage.css"
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&display=swap"
rel="stylesheet"
/>
<style>
body {
font-family: "Outfit";
}
@page {
margin: 0;
padding: 0;
size: A5 landscape;
size: 210mm 148mm;
}
@font-face {
font-family: "Outfit";
src: url("../../groupsData/static/Outfit-VariableFont_wght.ttf");
}
body {
margin: 0;
padding: 0;
font-family: "Outfit";
transform: scale(1);
transform-origin: 0 0;
}
</style>
</head>
<body>
<div style="height: 100vh; width: 100vw">
<div
style="
background-image: url(../../groupsData/shx-order-voucher-codes/backPageLogo.svg);
@ -34,13 +40,17 @@
background-size: 800px;
background-repeat: no-repeat;
background-position: center;
padding-top: 9px;
"
></div>
<div style="display: flex; justify-content: center; padding-top: 60px">
<div style="display: flex">
<div style="display: flex; justify-content: center">
<div style="display: flex; transform: scale(0.8)">
<div class="container">
<div class="container-background first-item"></div>
<img
class="container-background"
src="../../groupsData/shx-order-voucher-codes/background.svg"
/>
<div class="container-header">
<p><span class="percentage">10 %</span> auf Alles</p>
@ -77,7 +87,10 @@
</div>
<div class="container">
<div class="container-background second-item"></div>
<img
class="container-background"
src="../../groupsData/shx-order-voucher-codes/background.svg"
/>
<div class="container-header">
<p><span class="percentage">5 €</span> auf Alles</p>
@ -118,8 +131,11 @@
</div>
</div>
<div class="container">
<div class="container-background third-item"></div>
<div class="container" style="display: SHOW_THIRD_VOUCHER">
<img
class="container-background"
src="../../groupsData/shx-order-voucher-codes/background.svg"
/>
<div class="container-header">
<p><span class="percentage">10 €</span> auf Alles</p>
@ -169,11 +185,13 @@
</div>
</div>
<div style="padding-top: 80px; padding-left: 40px">
<div style="padding-top: 40px; padding-left: 40px">
<span style="font-size: 10px; color: #666666"
>*Die Angaben basieren jediglich auf Schätzungen. Die Verifizierung kann
bis zu 72 Stunden dauern, bis der Gutschein freigeschaltet wird.</span
>*Die Angaben basieren jediglich auf Schätzungen. Die Verifizierung
kann bis zu 72 Stunden dauern, bis der Gutschein freigeschaltet
wird.</span
>
</div>
</div>
</body>
</html>

View File

@ -4,21 +4,23 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link
href="https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&display=swap"
rel="stylesheet"
/>
<style>
body {
font-family: "Outfit";
font-size: 14px;
}
<style>
@page {
margin: 0 50px 0 50px;
padding: 0;
size: A5 landscape;
}
@font-face {
font-family: "Outfit";
src: url("../../groupsData/static/Outfit-VariableFont_wght.ttf");
}
body {
font-family: "Outfit";
font-size: 14px;
}
</style>
</head>
<body style="height: 550px; position: relative">

View File

@ -64,6 +64,20 @@ def CreateCrmCustomer():
return response.json()["Id"]
def show_third_voucher(show):
with open("backPage.html", "r") as file:
html = file.read()
if show:
print("Showing third voucher")
html = html.replace("SHOW_THIRD_VOUCHER", "block")
else:
print("Not showing third voucher")
html = html.replace("SHOW_THIRD_VOUCHER", "none")
with open("backPage.html", "w") as file:
file.write(html)
def CheckIfCrmCustomerExists():
print(f"Checking if customer exists: {customerEmail}")
@ -80,10 +94,14 @@ def CheckIfCrmCustomerExists():
sys.exit(1)
customerId = ""
# only on first purchase we show the third voucher
thirdVoucher = False
if response.json() == []:
print("Customer not found")
customerId = CreateCrmCustomer()
thirdVoucher = True
else:
if len(response.json()) > 1:
print("Multiple customers found. Don't know which one to use")
@ -91,11 +109,12 @@ def CheckIfCrmCustomerExists():
customerId = response.json()[0]["Id"]
CreateCrmActivityLink(customerId=customerId)
show_third_voucher(thirdVoucher)
CreateCrmActivityLink(customerId=customerId, thirdVoucher=thirdVoucher)
GetCustomerActivityLinks(customerId=customerId)
def CreateCrmActivityLink(customerId):
def CreateCrmActivityLink(customerId, thirdVoucher):
print(f"Creating CRM activity link for customer {customerId}")
def req(type, url):
@ -118,6 +137,8 @@ def CreateCrmActivityLink(customerId):
req("10 % Gutschein", f"https://shinnex.de/discount/{discountCode}{utm}")
req("5 € Gutschein", f"{productUrl}{utm}")
if thirdVoucher:
req("10 € Gutschein", f"https://docs.google.com/forms/d/e/1FAIpQLSd2GXFbidzazuQnh_Lf2mgeA1npuwHkWjsdmjrxDmSkDQTfew/viewform?entry.347359844={orderId}")

View File

@ -4,6 +4,7 @@
padding: 12px;
border-radius: 20px;
margin-right: 12px;
position: relative;
}
.container:last-child {
@ -12,28 +13,12 @@
.container-background {
position: absolute;
top: 0;
width: 330px;
height: 600px;
top: 50%;
left: 50%;
width: 200px;
z-index: 2;
background-image: url(background.svg);
background-repeat: no-repeat;
background-position: center;
background-size: 50%;
opacity: 0.1;
top: 25px;
}
.container-background.first-item {
left: 35px;
}
.container-background.second-item {
left: 325px;
}
.container-background.third-item {
left: 610px;
transform: translate(-50%, -50%);
}
.container-header {