-
Notifications
You must be signed in to change notification settings - Fork 623
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
Allow for Dynamic Templates Implementation #657
Allow for Dynamic Templates Implementation #657
Conversation
Thank you @mwillbanks! |
Hi. Thanks for working on this. Any news on this? |
@jideokus I'm actually using my branch with these changes in production right now. It works pretty much the exact same way as substitutions except that you can use anything as a parameter that is JSON Serializable.
|
Excellent. Thanks @mwillbanks. I'll take it for a spin. I have a bunch of emails waiting to be fired with this 😁 |
Hello @mwillbanks, |
Here is the final diff. |
Hi, first of all, thanks @mwillbanks for your contribution! I want to fetch all created templates from the API using as the example shows
But I guess this PR does not cover that point, did it? |
Please try the following: <?php
require 'vendor/autoload.php'; // If you're using Composer (recommended)
// Comment out the above line if not using Composer
// require("<PATH TO>/sendgrid-php.php");
// If not using Composer, uncomment the above line and
// download sendgrid-php.zip from the latest release here,
// replacing <PATH TO> with the path to the sendgrid-php.php file,
// which is included in the download:
// https://github.com/sendgrid/sendgrid-php/releases
$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
$query_params = json_decode('{"generations": "dynamic,legacy"}');
$response = $sg->client->templates()->get(null, $query_params);
print $response->statusCode() . "\n";
print $response->body() . "\n";
print_r($response->headers()); With Best Regards, Elmer |
Fixes #648
Checklist
Short description of what this PR does: