2d42152f54
user variable was unbound when user_id=None (guest purchase path). Added user=None in the else branch to prevent NameError when constructing the fallback email.