I'm using the code provided in answer 2 of SwiftUI: Send email and it works fine as is. However, in my app, I want to set the vc.setSubject to include some variables:
vc.setSubject("2020_\(riderFlagNumber)_\(activeBonus.category)_\(activeBonus.city)_\(activeBonus.state),\(activeBonus.code)")
riderFlagNumber comes from userDefaults and works fine; but the ones marked as activeBonus are coming from the navigation detail view that triggers the email. They come from an ObservableObject that appears to only be accessible from a view. How do I pass these variables from that view into the MFMailComposeViewController()?