alessiodevoto commited on
Commit
2cdbb7d
1 Parent(s): d87742b
Files changed (3) hide show
  1. README.md +1 -1
  2. newsletter_examples/1.html +15 -13
  3. src/utils.py +1 -1
README.md CHANGED
@@ -3,7 +3,7 @@ title: smartrec
3
  app_file: app.py
4
  sdk: gradio
5
  sdk_version: 5.7.0
6
- hf_oauth: true
7
  ---
8
  # smartrec
9
 
 
3
  app_file: app.py
4
  sdk: gradio
5
  sdk_version: 5.7.0
6
+ theme: light
7
  ---
8
  # smartrec
9
 
newsletter_examples/1.html CHANGED
@@ -66,6 +66,7 @@
66
  border-radius: 8px;
67
  border: 1px solid #DDDDDD;
68
  transition: transform 0.3s ease;
 
69
  }
70
 
71
  @media screen and (max-width: 600px) {
@@ -86,7 +87,7 @@
86
 
87
  .deal-box {
88
  background-color: #F4F4F4;
89
- color: #333333;
90
  padding: 20px;
91
  margin: 15px 0;
92
  border-radius: 8px;
@@ -120,7 +121,7 @@
120
  }
121
 
122
  a {
123
- color: #5A5A5A; /* Neutral dark links */
124
  text-decoration: none;
125
  }
126
 
@@ -138,21 +139,22 @@
138
 
139
  <!-- Personal Greeting -->
140
  <div class="nlsection">
141
- <p style="font-size: 18px; font-family: 'Georgia', 'Times New Roman', serif; font-style: italic; line-height: 1.5; color: #333; letter-spacing: 0.5px; text-align: left;">
142
  ${greeting} </p>
143
  </div>
144
 
145
  <!-- Previously Bought Items nlsection -->
146
  <div class="nlsection">
 
147
  <p 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;"> ${intro} </p>
148
  <div class="nlsection-row">
149
  <div class="bought-item">
150
  <img src= ${transaction_url} alt="Previous Product 1">
151
- <h3> ${transaction_name} </h3>
152
  </div>
153
  <div class="bought-item">
154
  <img src= ${transaction_url} alt="Previous Product 2">
155
- <h3>${transaction_name}</h3>
156
  </div>
157
  </div>
158
  </div>
@@ -164,12 +166,12 @@ ${recommendations} </p>
164
  <div class="nlsection-row">
165
  <div class="product">
166
  <img src=${recommendation_url} alt="Recommended Product 1">
167
- <h3>${recommendation_name}</h3>
168
  <a href="#" class="nlbutton" >Explore</a>
169
  </div>
170
  <div class="product">
171
  <img src=${recommendation_url} alt="Recommended Product 2">
172
- <h3>${recommendation_name}</h3>
173
  <a href="#" class="nlbutton">Explore</a>
174
  </div>
175
  </div>
@@ -183,12 +185,12 @@ Well, I always try my best and recommend what I think would suit you well, but h
183
  <p 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;">
184
  No worries though, I still have a lot of stuff for you! Take a look at these weekly deals! </p>
185
  <div class="deal-box">
186
- <h3> 30% OFF ALL DRESSES</h3>
187
- <p>Exclusive Code: LSF30</p>
188
  </div>
189
  <div class="deal-box">
190
- <h3> BUY 2 GET 1 FREE</h3>
191
- <p>On our curated accessories collection</p>
192
  </div>
193
  <p 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;">
194
  ${closing} </p>
@@ -203,8 +205,8 @@ ${closing} </p>
203
 
204
  <!-- nlfooter -->
205
  <div class="nlfooter">
206
- <p style="font-weight: bold;">The ${brand_name} Team</p>
207
- <p>
208
  <small>
209
  You're receiving this curated selection because you're part of our stylish community.
210
  <a href="#">Unsubscribe</a> | <a href="#">View in Browser</a>
 
66
  border-radius: 8px;
67
  border: 1px solid #DDDDDD;
68
  transition: transform 0.3s ease;
69
+ color: rgba(0,0,0,0.1);
70
  }
71
 
72
  @media screen and (max-width: 600px) {
 
87
 
88
  .deal-box {
89
  background-color: #F4F4F4;
90
+ color: rgba(0,0,0,0.1);
91
  padding: 20px;
92
  margin: 15px 0;
93
  border-radius: 8px;
 
121
  }
122
 
123
  a {
124
+ color: rgba(0,0,0,0.1); /* Neutral dark links */
125
  text-decoration: none;
126
  }
127
 
 
139
 
140
  <!-- Personal Greeting -->
141
  <div class="nlsection">
142
+ <p style="font-size: 18px; font-family: 'Georgia', 'Times New Roman', serif; font-style: italic; line-height: 1.5; color: black; letter-spacing: 0.5px; text-align: left;">
143
  ${greeting} </p>
144
  </div>
145
 
146
  <!-- Previously Bought Items nlsection -->
147
  <div class="nlsection">
148
+ <h2 style="color:black;"> Your recent selections </h2>
149
  <p 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;"> ${intro} </p>
150
  <div class="nlsection-row">
151
  <div class="bought-item">
152
  <img src= ${transaction_url} alt="Previous Product 1">
153
+ <h3 style="color:black;"> ${transaction_name} </h3>
154
  </div>
155
  <div class="bought-item">
156
  <img src= ${transaction_url} alt="Previous Product 2">
157
+ <h3 style="color:black;">${transaction_name}</h3>
158
  </div>
159
  </div>
160
  </div>
 
166
  <div class="nlsection-row">
167
  <div class="product">
168
  <img src=${recommendation_url} alt="Recommended Product 1">
169
+ <h3 style="color:black;">${recommendation_name}</h3>
170
  <a href="#" class="nlbutton" >Explore</a>
171
  </div>
172
  <div class="product">
173
  <img src=${recommendation_url} alt="Recommended Product 2">
174
+ <h3 style="color:black;">${recommendation_name}</h3>
175
  <a href="#" class="nlbutton">Explore</a>
176
  </div>
177
  </div>
 
185
  <p 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;">
186
  No worries though, I still have a lot of stuff for you! Take a look at these weekly deals! </p>
187
  <div class="deal-box">
188
+ <h3 style="color:black;"> 30% OFF ALL DRESSES</h3>
189
+ <p style="color:black;">Exclusive Code: LSF30</p>
190
  </div>
191
  <div class="deal-box">
192
+ <h3 style="color:black;"> BUY 2 GET 1 FREE</h3>
193
+ <p style="color:black;">On our curated accessories collection</p>
194
  </div>
195
  <p 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;">
196
  ${closing} </p>
 
205
 
206
  <!-- nlfooter -->
207
  <div class="nlfooter">
208
+ <p style="font-weight: bold; color:black">The ${brand_name} Team</p>
209
+ <p style="color:black;">
210
  <small>
211
  You're receiving this curated selection because you're part of our stylish community.
212
  <a href="#">Unsubscribe</a> | <a href="#">View in Browser</a>
src/utils.py CHANGED
@@ -130,7 +130,7 @@ def integrate_personalized_text(newsletter_text, customer_info, textual_sections
130
 
131
  # make sure the greeting line is h1, so replace Hello ${customer_name} with <h1>Hello ${customer_name}</h1>
132
  customer_name = customer_info.get("customer name")
133
- newsletter_text = newsletter_text.replace(f"Hello {customer_name},", f"<h1>Hello {customer_name},</h1>")
134
 
135
  return newsletter_text
136
 
 
130
 
131
  # make sure the greeting line is h1, so replace Hello ${customer_name} with <h1>Hello ${customer_name}</h1>
132
  customer_name = customer_info.get("customer name")
133
+ newsletter_text = newsletter_text.replace(f"Hello {customer_name},", f'<h1 style="color:black;">Hello {customer_name},</h1>')
134
 
135
  return newsletter_text
136