Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use json env resolver in configurations #28137

Closed
@ln-e

Description

@ln-e

Symfony version(s) affected: 4.1
Description
I want to be able to configure swiftmailer delivery_adresses via env var. In prod env on production server it should be null, in prod env on staging server it should have some value. Looks like work for env parameters.

I try to set it like

swiftmailer:
    delivery_addresses: '%env(json:MAILER_DELIVERY_ADDRESSES)%'

I specify json env processor, and in my env file

MAILER_DELIVERY_ADDRESSES='["[email protected]"]'
A dynamic value is not compatible with a "Symfony\Component\Config\Definition\PrototypedArrayNode" node type at path "swiftmailer.mailers.default.delivery_addresses".

Json processor return array, and so it should be valid to pass such value to PrototypedArrayNode.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions