Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting options on the SendGrid object #1

Open
pdesmarais opened this issue Aug 5, 2014 · 3 comments
Open

Setting options on the SendGrid object #1

pdesmarais opened this issue Aug 5, 2014 · 3 comments

Comments

@pdesmarais
Copy link

Hi there,

The SendGrid docs say that we can specify options on the SendGrid object with an array of options as the third argument to the __construct(). See https://github.com/sendgrid/sendgrid-php/blob/master/README.md#options

How could that be done using your service?

Thanks!

@pdesmarais
Copy link
Author

Your config supports 2 arguments other than username or password:

->booleanNode('turn_off_ssl_verification')->end()
->booleanNode('enable_short_alias')->defaultTrue()->end()

Do you think this should be done using an array instead which would futureproof the functionality if SendGrid adds more available options in the future?

@hackzilla
Copy link

I'd override the service definition, so you could pass in your own options.

        <service id="tystr_sendgrid.sendgrid" class="%tystr_sendgrid.sendgrid.class%">
            <argument>%tystr_sendgrid.username%</argument>
            <argument>%tystr_sendgrid.password%</argument>
        </service>

@hackzilla
Copy link

in services.yml

    tystr_sendgrid.sendgrid:
        class: '%tystr_sendgrid.sendgrid.class%'
        arguments:
            - '%tystr_sendgrid.username%'
            - '%tystr_sendgrid.password%'
            -
                enable_guzzle_exceptions: false
                turn_off_ssl_verification: false
                raise_exceptions: false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants