Spaces:
Sleeping
Sleeping
Arcangelo Pisa
commited on
Commit
•
3c8d5e3
1
Parent(s):
4a361b5
add board
Browse files- newsletter_examples/2.html +22 -11
- src/utils.py +4 -0
newsletter_examples/2.html
CHANGED
@@ -159,21 +159,29 @@
|
|
159 |
${greeting} </p>
|
160 |
</div>
|
161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
<!-- Previously Bought Items nlsection -->
|
163 |
<div class="nlsection">
|
164 |
-
|
165 |
-
<p
|
166 |
-
style="font-size: 18px; font-family: 'Georgia', 'Times New Roman', serif; font-style: italic; color: #333; line-height: 1.5; letter-spacing: 0.5px; text-align: left;">
|
167 |
-
${intro} </p>
|
168 |
-
<h2 style="color:black;"> Your recent selections </h2>
|
169 |
<div class="nlsection-row">
|
170 |
<div class="bought-item">
|
171 |
<img src=${transaction_url} alt="Previous Product 1">
|
172 |
<h3 style="color:black;"> ${transaction_name} </h3>
|
173 |
</div>
|
174 |
-
|
175 |
-
|
176 |
-
<
|
|
|
177 |
</div>
|
178 |
</div>
|
179 |
</div>
|
@@ -181,9 +189,9 @@
|
|
181 |
<!-- Recommended Items -->
|
182 |
<div class="nlsection">
|
183 |
<div class="nlsection-row">
|
184 |
-
<div class="
|
185 |
-
<img src=${
|
186 |
-
<h3 style="color:black;">${
|
187 |
</div>
|
188 |
<div class="product">
|
189 |
<img src=${recommendation_url} alt="Recommended Product 2">
|
@@ -196,7 +204,10 @@
|
|
196 |
style="font-size: 18px; font-family: 'Georgia', 'Times New Roman', serif; font-style: italic; color: #333; line-height: 1.5; letter-spacing: 0.5px; text-align: left; padding-bottom: 30px;">
|
197 |
${recommendations} </p>
|
198 |
|
|
|
199 |
<div style="background-color: #EBEAE8; padding: 20px; border-radius: 10px;">
|
|
|
|
|
200 |
<!-- Previously Bought Items nlsection -->
|
201 |
<div class="nlsection">
|
202 |
<div class="nlsection-row">
|
|
|
159 |
${greeting} </p>
|
160 |
</div>
|
161 |
|
162 |
+
|
163 |
+
<p
|
164 |
+
style="font-size: 18px; font-family: 'Georgia', 'Times New Roman', serif; font-style: italic; color: #333; line-height: 1.5; letter-spacing: 0.5px; text-align: left;">
|
165 |
+
${intro} </p>
|
166 |
+
|
167 |
+
<div>
|
168 |
+
<div class="nlsection-row" style="justify-content: space-around;">
|
169 |
+
<h2 style="color:black;">Your selections</h2>
|
170 |
+
<h2 style="color:black;">We think you'd like</h2>
|
171 |
+
</div>
|
172 |
+
</div>
|
173 |
+
|
174 |
<!-- Previously Bought Items nlsection -->
|
175 |
<div class="nlsection">
|
|
|
|
|
|
|
|
|
|
|
176 |
<div class="nlsection-row">
|
177 |
<div class="bought-item">
|
178 |
<img src=${transaction_url} alt="Previous Product 1">
|
179 |
<h3 style="color:black;"> ${transaction_name} </h3>
|
180 |
</div>
|
181 |
+
|
182 |
+
<div class="product">
|
183 |
+
<img src=${recommendation_url} alt="Recommended Product 1">
|
184 |
+
<h3 style="color:black;">${recommendation_name}</h3>
|
185 |
</div>
|
186 |
</div>
|
187 |
</div>
|
|
|
189 |
<!-- Recommended Items -->
|
190 |
<div class="nlsection">
|
191 |
<div class="nlsection-row">
|
192 |
+
<div class="bought-item">
|
193 |
+
<img src=${transaction_url} alt="Previous Product 2">
|
194 |
+
<h3 style="color:black;">${transaction_name}</h3>
|
195 |
</div>
|
196 |
<div class="product">
|
197 |
<img src=${recommendation_url} alt="Recommended Product 2">
|
|
|
204 |
style="font-size: 18px; font-family: 'Georgia', 'Times New Roman', serif; font-style: italic; color: #333; line-height: 1.5; letter-spacing: 0.5px; text-align: left; padding-bottom: 30px;">
|
205 |
${recommendations} </p>
|
206 |
|
207 |
+
|
208 |
<div style="background-color: #EBEAE8; padding: 20px; border-radius: 10px;">
|
209 |
+
<h2 style="color:black;">See it all together</h2>
|
210 |
+
|
211 |
<!-- Previously Bought Items nlsection -->
|
212 |
<div class="nlsection">
|
213 |
<div class="nlsection-row">
|
src/utils.py
CHANGED
@@ -117,11 +117,15 @@ def initialize_newsletter(newsletter_meta_info, transactions, recommendations):
|
|
117 |
for i, transaction in enumerate(transactions):
|
118 |
newsletter_text = newsletter_text.replace("${transaction_url}", transaction['product_image_url'], 1)
|
119 |
newsletter_text = newsletter_text.replace("${transaction_name}", transaction['product_name'], 1)
|
|
|
|
|
120 |
|
121 |
# iterate over the recommendations and replace the placeholders with the actual content
|
122 |
for i, recommendation in enumerate(recommendations):
|
123 |
newsletter_text = newsletter_text.replace("${recommendation_url}", recommendation['product_image_url'], 1)
|
124 |
newsletter_text = newsletter_text.replace("${recommendation_name}", recommendation['product_name'], 1)
|
|
|
|
|
125 |
return newsletter_text
|
126 |
|
127 |
|
|
|
117 |
for i, transaction in enumerate(transactions):
|
118 |
newsletter_text = newsletter_text.replace("${transaction_url}", transaction['product_image_url'], 1)
|
119 |
newsletter_text = newsletter_text.replace("${transaction_name}", transaction['product_name'], 1)
|
120 |
+
newsletter_text = newsletter_text.replace("${transaction_url_board}", transaction['product_image_url'], 1)
|
121 |
+
newsletter_text = newsletter_text.replace("${transaction_name_board}", transaction['product_name'], 1)
|
122 |
|
123 |
# iterate over the recommendations and replace the placeholders with the actual content
|
124 |
for i, recommendation in enumerate(recommendations):
|
125 |
newsletter_text = newsletter_text.replace("${recommendation_url}", recommendation['product_image_url'], 1)
|
126 |
newsletter_text = newsletter_text.replace("${recommendation_name}", recommendation['product_name'], 1)
|
127 |
+
newsletter_text = newsletter_text.replace("${recommendation_url_board}", recommendation['product_image_url'], 1)
|
128 |
+
newsletter_text = newsletter_text.replace("${recommendation_name_board}", recommendation['product_name'], 1)
|
129 |
return newsletter_text
|
130 |
|
131 |
|