# 1. Create dynamic body depending on status if user_status == "paid": body = f"Hello paid user: {user.first_name} {user_status}" else: body = f"Hello not paid user: {user.first_name} {user_status}" # 2. Add it to recipient email substitutions to_emails.append( To( email=user.user_email, name=user.first_name, substitutions={"-user_email-": user.user_email, "-email_body-": body}, subject=f"Subject Goes Here {user.first_name}", ) ), # 3. Create a mail object with that substituted content html_body = "