Fix for submitting multiple recipients to a list simultaneously.#1
Fix for submitting multiple recipients to a list simultaneously.#1kander-zz wants to merge 1 commit intoNeoseeker:masterfrom
Conversation
|
Hi Kander, Thanks for the pull request. Just curious, is there a reason to rewrite postData in Connect rather than Newsletter, where it would be less likely to affect other calls? |
|
Hi @redemption - I've wrestled with that for some time before settling on doing it in the Connect class. Connect::makeApiCall() assumes that the incoming $postData is an array, so it can add the username/password variables. If I were to do the encoding in Newsletter, that would mean doing either a copy-past re-implementation of makeApiCall, or add some magical flag indicating that the content was querystring-encoded already, and let Newsletter take on additional responsibility of injecting the user credentials. On the other hand, Curl will have to do some form of http_build_query() internally to convert the array to a query string anyway, so the implementation should not be affected. And if SendGrid chooses to use this method for sending a collection of values, they're probably going to be consistent and do it this way in any other place that might need a collection. |
Hi NeoSeekers - thanks for putting in the work to make this library PSR-0 compliant and Composer-loadable. Much appreciated!
Yesterday I spent some time working with SendGrid Support, trying to find out how I could load multiple users into a recipient list simultaneously. This is documented in the Newsletter API Documentation, under the curl examples.
Problem is that SendGrid wants us to submit the same parameter multiple times (data[]). Using numeric indexes in the array does not work, so what I ended up doing is manually building up the HTTP PostData querystring.