Skip to content

Commit

Permalink
Merge pull request #866 from sendgrid/thinkingserious-templates
Browse files Browse the repository at this point in the history
Fix #863 Not able to get the template list
  • Loading branch information
thinkingserious authored Jan 3, 2019
2 parents f8bd5e7 + 0011b94 commit 9d65fa0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2012-2018 SendGrid, Inc.
Copyright (c) 2012-2019 SendGrid, Inc.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
29 changes: 27 additions & 2 deletions packages/client/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4644,18 +4644,43 @@ Each user can create up to 300 different transactional templates. Transactional

Transactional templates are templates explicitly created for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).

### GET /templates
### GET all dynamic /templates

```javascript
request.method = 'GET';
request.url = '/v3/templates?generations=dynamic';
client.request(request)
.then(([response, body]) => {
console.log(response.statusCode);
console.log(response.body);
})
```

### GET all legacy /templates


```javascript
request.method = 'GET';
request.url = '/v3/templates';
request.url = '/v3/templates?generations=legacy';
client.request(request)
.then(([response, body]) => {
console.log(response.statusCode);
console.log(response.body);
})
```

### GET all /templates

```javascript
request.method = 'GET';
request.url = '/v3/templates?generations=legacy,dynamic';
client.request(request)
.then(([response, body]) => {
console.log(response.statusCode);
console.log(response.body);
})
```

## Delete a template.

**This endpoint allows you to delete a transactional template.**
Expand Down

0 comments on commit 9d65fa0

Please sign in to comment.