2929 is_admin ,
3030)
3131from storage .birthdays import (
32+ CELEBRATION_STYLE_EMOJIS ,
33+ CELEBRATION_STYLES ,
34+ get_user_preferences ,
3235 remove_birthday ,
3336 save_birthday ,
3437)
3841 check_if_birthday_today ,
3942 date_to_words ,
4043 extract_date ,
44+ get_star_sign ,
4145)
4246
4347# Confirmation timeout from centralized config
@@ -332,19 +336,28 @@ def handle_dm_date(say, user, result, app):
332336 try :
333337 from slack .blocks import build_confirmation_blocks
334338
339+ # Get star sign and celebration style for confirmation
340+ star_sign = get_star_sign (date )
341+ prefs = get_user_preferences (user ) or {}
342+ celebration_style = prefs .get ("celebration_style" , "standard" )
343+ style_emoji = CELEBRATION_STYLE_EMOJIS .get (celebration_style , "🎊" )
344+ style_desc = CELEBRATION_STYLES .get (celebration_style , "Standard celebration" )
345+
346+ # Build details dict
347+ details = {
348+ "📅 Birthday" : date_words ,
349+ "⭐ Star Sign" : star_sign ,
350+ }
351+ if age_text :
352+ details ["🎈 Age" ] = age_text .replace (" (Age: " , "" ).replace (")" , "" )
353+ details [f"{ style_emoji } Style" ] = f"{ celebration_style .title ()} - { style_desc } "
354+
335355 if updated :
336356 blocks , fallback = build_confirmation_blocks (
337357 title = "Birthday Updated!" ,
338358 message = "Your birthday has been updated successfully.\n \n If this is incorrect, please send the correct date." ,
339359 action_type = "success" ,
340- details = {
341- "Birthday" : date_words ,
342- "Age" : (
343- age_text .replace (" (Age: " , "" ).replace (")" , "" )
344- if age_text
345- else "Not specified"
346- ),
347- },
360+ details = details ,
348361 )
349362 say (blocks = blocks , text = fallback )
350363 logger .info (
@@ -355,14 +368,7 @@ def handle_dm_date(say, user, result, app):
355368 title = "Birthday Saved!" ,
356369 message = "Your birthday has been saved successfully!\n \n If this is incorrect, please send the correct date." ,
357370 action_type = "success" ,
358- details = {
359- "Birthday" : date_words ,
360- "Age" : (
361- age_text .replace (" (Age: " , "" ).replace (")" , "" )
362- if age_text
363- else "Not specified"
364- ),
365- },
371+ details = details ,
366372 )
367373 say (blocks = blocks , text = fallback )
368374 logger .info (
@@ -391,10 +397,10 @@ def handle_dm_date(say, user, result, app):
391397 )
392398
393399 # Send external backup after user confirmation to avoid API conflicts
394- _send_external_backup_if_enabled (updated , username , app )
400+ _send_external_backup_if_enabled (updated , username , app , user_id = user )
395401
396402
397- def _send_external_backup_if_enabled (updated , username , app , change_type = None ):
403+ def _send_external_backup_if_enabled (updated , username , app , change_type = None , user_id = None ):
398404 """
399405 Send external backup after birthday changes if enabled.
400406
@@ -403,10 +409,11 @@ def _send_external_backup_if_enabled(updated, username, app, change_type=None):
403409 username: Username of the person whose birthday changed
404410 app: Slack app instance for sending backup
405411 change_type: Optional override for change type ("add", "update", "remove")
412+ user_id: User ID of the person whose birthday changed (for preferences lookup)
406413 """
407414 from storage .birthdays import trigger_external_backup
408415
409- trigger_external_backup (updated , username , app , change_type )
416+ trigger_external_backup (updated , username , app , change_type , user_id )
410417
411418
412419def handle_command (text , user_id , say , app ):
@@ -564,19 +571,28 @@ def _handle_add_command(parts, user_id, username, say, app):
564571 try :
565572 from slack .blocks import build_confirmation_blocks
566573
574+ # Get star sign and celebration style for confirmation
575+ star_sign = get_star_sign (date )
576+ prefs = get_user_preferences (user_id ) or {}
577+ celebration_style = prefs .get ("celebration_style" , "standard" )
578+ style_emoji = CELEBRATION_STYLE_EMOJIS .get (celebration_style , "🎊" )
579+ style_desc = CELEBRATION_STYLES .get (celebration_style , "Standard celebration" )
580+
581+ # Build details dict
582+ details = {
583+ "📅 Birthday" : date_words ,
584+ "⭐ Star Sign" : star_sign ,
585+ }
586+ if age_text :
587+ details ["🎈 Age" ] = age_text .replace (" (Age: " , "" ).replace (")" , "" )
588+ details [f"{ style_emoji } Style" ] = f"{ celebration_style .title ()} - { style_desc } "
589+
567590 if updated :
568591 blocks , fallback = build_confirmation_blocks (
569592 title = "Birthday Updated!" ,
570593 message = "Your birthday has been updated successfully." ,
571594 action_type = "success" ,
572- details = {
573- "Birthday" : date_words ,
574- "Age" : (
575- age_text .replace (" (Age: " , "" ).replace (")" , "" )
576- if age_text
577- else "Not specified"
578- ),
579- },
595+ details = details ,
580596 )
581597 say (blocks = blocks , text = fallback )
582598 logger .info (
@@ -587,14 +603,7 @@ def _handle_add_command(parts, user_id, username, say, app):
587603 title = "Birthday Saved!" ,
588604 message = "Your birthday has been saved successfully!" ,
589605 action_type = "success" ,
590- details = {
591- "Birthday" : date_words ,
592- "Age" : (
593- age_text .replace (" (Age: " , "" ).replace (")" , "" )
594- if age_text
595- else "Not specified"
596- ),
597- },
606+ details = details ,
598607 )
599608 say (blocks = blocks , text = fallback )
600609 logger .info (
@@ -619,7 +628,7 @@ def _handle_add_command(parts, user_id, username, say, app):
619628 )
620629
621630 # Send external backup after user confirmation
622- _send_external_backup_if_enabled (updated , username , app )
631+ _send_external_backup_if_enabled (updated , username , app , user_id = user_id )
623632
624633
625634def _handle_remove_command (user_id , username , say , app ):
0 commit comments