@@ -33,7 +33,7 @@ def send_email(to_email, subject, html_content):
3333        return  False 
3434
3535
36- def  build_html_email (username , title , link , solved , quote = None , hints = None ):
36+ def  build_html_email (username , title , difficulty ,  link , solved , quote = None , hints = None ):
3737    """Builds a responsive email with optional AI hints, quotes, and a live countdown GIF.""" 
3838
3939    if  hints  is  None :
@@ -53,9 +53,20 @@ def build_html_email(username, title, link, solved, quote=None, hints=None):
5353    else :
5454        preheader_text  =  f"Don't forget to solve { title }  
5555        heading  =  f"Hey <a href='https://leetcode.com/u/{ username } { username }  
56-         subtext  =  f"Today's problem, <strong>{ title }  
5756        button_text  =  f"Solve '{ title }  
58-         button_color  =  "#000000"  
57+         pill_color  =  {
58+             "Easy" : "#43AA03" ,    
59+             "Medium" : "#FFBB00" , 
60+             "Hard" : "#f8615c"      
61+         }[difficulty ]
62+         difficulty_badge  =  (
63+             f"<span style='display:inline-block; padding:4px 10px; " 
64+             f"font-size:12px; font-weight:700; color:{ pill_color }  
65+             f"background:#00000030; line-height:1; vertical-align:middle;'>" 
66+             f"{ difficulty }  
67+         )
68+         subtext  =  (f"Today's problem, <strong>{ title } { difficulty_badge }  
69+                f"Don't miss out on your streak!" )
5970        footer  =  f"<em>“{ quote }   if  quote  else  "<em>“Small daily improvements lead to big results.” 🌱</em>" 
6071
6172        deadline_iso  =  get_deadline_for_potd ()
@@ -160,11 +171,10 @@ def build_html_email(username, title, link, solved, quote=None, hints=None):
160171                                <p style="margin: 0 0 30px 0; font-size: 16px; line-height: 1.6;"> 
161172                                    { subtext }  
162173                                </p> 
163-                                  
164174                                <table border="0" cellpadding="0" cellspacing="0" width="100%"> 
165175                                    <tr> 
166176                                        <td align="center"> 
167-                                             <a href="{ link } { button_color }  
177+                                             <a href="{ link } #000000 ; color: #ffffff; font-size: 16px; font-weight: bold; text-decoration: none; padding: 14px 22px; border-radius: 5px; display: inline-block;"> 
168178                                                { button_text }  
169179                                            </a> 
170180                                        </td> 
0 commit comments