When using an app (e.g. Klaviyo) that auto-generates discount codes for email marketing, there is no way to automatically make the discounts available for Subscriptions.
A task could help with modifying all discount codes automatically as soon as they are created to include 'Both' purchase types. See attached screenshot.