Open pdesmarais opened 10 years ago
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?
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>
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
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!