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,172 +8,190 @@
rel="stylesheet" rel="stylesheet"
href="../../groupsData/shx-order-voucher-codes/backPage.css" 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> <style>
body {
font-family: "Outfit";
}
@page { @page {
margin: 0; margin: 0;
padding: 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> </style>
</head> </head>
<body> <body>
<div <div style="height: 100vh; width: 100vw">
style=" <div
background-image: url(../../groupsData/shx-order-voucher-codes/backPageLogo.svg); style="
height: 80px; background-image: url(../../groupsData/shx-order-voucher-codes/backPageLogo.svg);
background-size: 800px; height: 80px;
background-repeat: no-repeat; background-size: 800px;
background-position: center; background-repeat: no-repeat;
" background-position: center;
></div> padding-top: 9px;
"
<div style="display: flex; justify-content: center; padding-top: 60px"> ></div>
<div style="display: flex">
<div class="container">
<div class="container-background first-item"></div>
<div class="container-header">
<p><span class="percentage">10 %</span> auf Alles</p>
<div style="display: flex; justify-content: center">
<div style="display: flex; transform: scale(0.8)">
<div class="container">
<img <img
loading="lazy" class="container-background"
height="28px" src="../../groupsData/shx-order-voucher-codes/background.svg"
alt=""
src="../../groupsData/shx-order-voucher-codes/icon_lock_open.svg"
/> />
</div>
<div class="container-action"> <div class="container-header">
<img class="image-11-icon" alt="" src="./10percent.png" /> <p><span class="percentage">10 %</span> auf Alles</p>
<div> <img
<div class="status-box"> loading="lazy"
<span class="open">Freigeschaltet</span> height="28px"
alt=""
src="../../groupsData/shx-order-voucher-codes/icon_lock_open.svg"
/>
</div>
<div class="container-action">
<img class="image-11-icon" alt="" src="./10percent.png" />
<div>
<div class="status-box">
<span class="open">Freigeschaltet</span>
</div>
</div> </div>
</div> </div>
<p>
Glückwunsch! Du hast soeben einen Gutschein im Wert von 10 %
erhalten!
</p>
<p style="padding-bottom: 22px">
Scanne den QR-Code, um direkt zum Shop zu gelangen.
</p>
<div class="code-box first-item" style="margin-top: 39px">
<span>{{DISCOUNT_CODE}}</span>
</div>
</div> </div>
<p> <div class="container">
Glückwunsch! Du hast soeben einen Gutschein im Wert von 10 %
erhalten!
</p>
<p style="padding-bottom: 22px">
Scanne den QR-Code, um direkt zum Shop zu gelangen.
</p>
<div class="code-box first-item" style="margin-top: 39px">
<span>{{DISCOUNT_CODE}}</span>
</div>
</div>
<div class="container">
<div class="container-background second-item"></div>
<div class="container-header">
<p><span class="percentage">5 €</span> auf Alles</p>
<img <img
loading="lazy" class="container-background"
height="28px" src="../../groupsData/shx-order-voucher-codes/background.svg"
alt=""
src="../../groupsData/shx-order-voucher-codes/icon_lock_closed.svg"
/> />
</div>
<div class="container-action"> <div class="container-header">
<img class="image-11-icon" alt="" src="./5euro.png" /> <p><span class="percentage">5 €</span> auf Alles</p>
<div> <img
<div class="status-box"> loading="lazy"
<span class="closed">Freischaltbar</span> height="28px"
</div> alt=""
<div class="time-needed-box"> src="../../groupsData/shx-order-voucher-codes/icon_lock_closed.svg"
<span>Dauer: 5 Minuten*</span> />
</div>
<div class="container-action">
<img class="image-11-icon" alt="" src="./5euro.png" />
<div>
<div class="status-box">
<span class="closed">Freischaltbar</span>
</div>
<div class="time-needed-box">
<span>Dauer: 5 Minuten*</span>
</div>
</div> </div>
</div> </div>
<p>
Bewerte dein gekauftes Produkt in unserem Shop und erhalte einen
Gutschein im Wert von 5 €!
</p>
<p>Scanne den QR-Code, um zu bewerten.</p>
<div class="minimum-order-value-box" style="margin-top: 37px">
<span>Mindestbestellwert beträgt 25 €</span>
</div>
<div class="code-box second-item">
<span>********</span>
</div>
</div> </div>
<p> <div class="container" style="display: SHOW_THIRD_VOUCHER">
Bewerte dein gekauftes Produkt in unserem Shop und erhalte einen
Gutschein im Wert von 5 €!
</p>
<p>Scanne den QR-Code, um zu bewerten.</p>
<div class="minimum-order-value-box" style="margin-top: 37px">
<span>Mindestbestellwert beträgt 25 €</span>
</div>
<div class="code-box second-item">
<span>********</span>
</div>
</div>
<div class="container">
<div class="container-background third-item"></div>
<div class="container-header">
<p><span class="percentage">10 €</span> auf Alles</p>
<img <img
loading="lazy" class="container-background"
height="28px" src="../../groupsData/shx-order-voucher-codes/background.svg"
alt=""
src="../../groupsData/shx-order-voucher-codes/icon_lock_closed.svg"
/> />
</div>
<div class="container-action"> <div class="container-header">
<img class="image-11-icon" alt="" src="./10euro.png" /> <p><span class="percentage">10 €</span> auf Alles</p>
<div> <img
<div class="status-box"> loading="lazy"
<span class="closed">Freischaltbar</span> height="28px"
</div> alt=""
<div class="time-needed-box"> src="../../groupsData/shx-order-voucher-codes/icon_lock_closed.svg"
<span>Dauer: 5 Minuten*</span> />
</div>
<div class="container-action">
<img class="image-11-icon" alt="" src="./10euro.png" />
<div>
<div class="status-box">
<span class="closed">Freischaltbar</span>
</div>
<div class="time-needed-box">
<span>Dauer: 5 Minuten*</span>
</div>
</div> </div>
</div> </div>
</div>
<p> <p>
Erstelle einen Beitrag auf Instagram, markiere und folge Erstelle einen Beitrag auf Instagram, markiere und folge
<img <img
src="../../groupsData/shx-order-voucher-codes/@shinnex.official.svg" src="../../groupsData/shx-order-voucher-codes/@shinnex.official.svg"
height="13px" height="13px"
style="margin-bottom: 4.1px; vertical-align: middle" style="margin-bottom: 4.1px; vertical-align: middle"
/> />
und erhalte einen Gutschein in Wert von 10 €! und erhalte einen Gutschein in Wert von 10 €!
</p> </p>
<p> <p>
Scanne den QR-Code, um deinen geposteten Beitrag zu verifizieren. Scanne den QR-Code, um deinen geposteten Beitrag zu verifizieren.
</p> </p>
<div class="minimum-order-value-box"> <div class="minimum-order-value-box">
<span>Mindestbestellwert beträgt 25 €</span> <span>Mindestbestellwert beträgt 25 €</span>
</div> </div>
<div class="code-box third-item"> <div class="code-box third-item">
<span>********</span> <span>********</span>
</div>
</div> </div>
</div> </div>
</div> </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" <span style="font-size: 10px; color: #666666"
>*Die Angaben basieren jediglich auf Schätzungen. Die Verifizierung kann >*Die Angaben basieren jediglich auf Schätzungen. Die Verifizierung
bis zu 72 Stunden dauern, bis der Gutschein freigeschaltet wird.</span kann bis zu 72 Stunden dauern, bis der Gutschein freigeschaltet
> wird.</span
>
</div>
</div> </div>
</body> </body>
</html> </html>

View File

@ -4,21 +4,23 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title> <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 { @page {
margin: 0 50px 0 50px; margin: 0 50px 0 50px;
padding: 0; padding: 0;
size: A5 landscape; size: A5 landscape;
} }
@font-face {
font-family: "Outfit";
src: url("../../groupsData/static/Outfit-VariableFont_wght.ttf");
}
body {
font-family: "Outfit";
font-size: 14px;
}
</style> </style>
</head> </head>
<body style="height: 550px; position: relative"> <body style="height: 550px; position: relative">

View File

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

View File

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