Skip to content

Commit cf07583

Browse files
Version Bump v3.0.0: full v3 Web API support
1 parent 334c083 commit cf07583

4 files changed

Lines changed: 23 additions & 68 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4-
## [3.0.0] - XXXX-XX-XX
4+
## [3.0.0] - 2016-06-13
55
### Added
66
- Breaking change to support the v3 Web API
77
- New HTTP client

README.md

Lines changed: 14 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,7 @@
44

55
# Announcements
66

7-
**NOTE: The `/mail/send/beta` endpoint is currently in beta!
8-
9-
Since this is not a general release, we do not recommend POSTing production level traffic through this endpoint or integrating your production servers with this endpoint.
10-
11-
When this endpoint is ready for general release, your code will require an update in order to use the official URI.
12-
13-
By using this endpoint, you accept that you may encounter bugs and that the endpoint may be taken down for maintenance at any time. We cannot guarantee the continued availability of this beta endpoint. We hope that you like this new endpoint and we appreciate any [feedback](dx+mail-beta@sendgrid.com) that you can send our way.**
14-
15-
**BREAKING CHANGE as of XXXX.XX.XX**
7+
**BREAKING CHANGE as of 2016.06.14**
168

179
Version `3.0.0` is a breaking change for the entire library.
1810

@@ -22,17 +14,17 @@ have the following resources to get you started quickly:
2214
- [SendGrid
2315
Documentation](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html)
2416
- [Usage
25-
Documentation](https://github.com/sendgrid/sendgrid-java/tree/v2beta/USAGE.md)
17+
Documentation](https://github.com/sendgrid/sendgrid-java/tree/master/USAGE.md)
2618
- [Example
27-
Code](https://github.com/sendgrid/sendgrid-java/tree/v2beta/examples)
19+
Code](https://github.com/sendgrid/sendgrid-java/tree/master/examples)
2820

2921
Thank you for your continued support!
3022

31-
All updates to this library is documented in our [CHANGELOG](https://github.com/sendgrid/sendgrid-java/blob/v3beta/CHANGELOG.md).
23+
All updates to this library is documented in our [CHANGELOG](https://github.com/sendgrid/sendgrid-java/blob/master/CHANGELOG.md).
3224

3325
# Installation
3426

35-
## Environment Variables
27+
## Setup Environment Variables
3628

3729
First, get your free SendGrid account [here](https://sendgrid.com/free?source=sendgrid-java).
3830

@@ -43,44 +35,7 @@ echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
4335
echo "sendgrid.env" >> .gitignore
4436
source ./sendgrid.env
4537
```
46-
## TRYING OUT THE V3 BETA MAIL SEND
47-
48-
```bash
49-
git clone -b v3beta --single-branch https://github.com/sendgrid/sendgrid-java.git
50-
cd sendgrid-java
51-
./gradlew build
52-
```
53-
54-
* Update the to and from [emails](https://github.com/sendgrid/sendgrid-java/blob/v3beta/examples/Mail/Example.java#L35).
55-
56-
```bash
57-
cd examples/helpers/mail
58-
javac -classpath ../../examples/dependencies/jackson-annotations-2.7.0.jar:../../examples/dependencies/jackson-databind-2.7.3.jar:../../examples/dependencies/jackson-core-2.7.3.jar:../../../build/libs/sendgrid-3.0.0-jar.jar:. Example.java && java -classpath ../../examples/dependencies/jackson-annotations-2.7.0.jar:../../examples/dependencies/jackson-databind-2.7.3.jar:../../examples/dependencies/jackson-core-2.7.3.jar:../../../build/libs/sendgrid-3.0.0-jar.jar:. Example
59-
```
60-
61-
## TRYING OUT THE V3 BETA WEB API
62-
63-
```bash
64-
git clone -b v3beta --single-branch https://github.com/sendgrid/sendgrid-java.git
65-
```
66-
67-
* Check out the documentation for [Web API v3 endpoints](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html).
68-
* Review the corresponding [examples](https://github.com/sendgrid/sendgrid-python/blob/v3beta/examples).
69-
70-
```bash
71-
cd examples
72-
touch Example.java
73-
```
74-
75-
Add the example you want to test to Example.java, including the headers at the top of the file.
76-
77-
``` bash
78-
javac -classpath ./dependencies/jackson-annotations-2.7.0.jar:./dependencies/jackson-databind-2.7.3.jar:./dependencies/jackson-core-2.7.3.jar:../build/libs/sendgrid-3.0.0-jar.jar:. Example.java && java -classpath ./dependencies/jackson-annotations-2.7.0.jar:./dependencies/jackson-databind-2.7.3.jar:./dependencies/jackson-core-2.7.3.jar:../build/libs/sendgrid-3.0.0-jar.jar:. Example
79-
```
80-
81-
* Check out the documentation for [Web API v3 /mail/send/beta endpoint](https://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/index.html).
82-
83-
## Once we are out of v3 BETA, the following will apply
38+
## Install Package
8439

8540
Choose your installation method - Maven w/ Gradle (recommended), Maven or Jar file.
8641

@@ -117,7 +72,7 @@ mvn install
11772

11873
You can just drop the jar file in. It's a fat jar - it has all the dependencies built in.
11974

120-
[sendgrid-java.jar](https://sendgrid-open-source.s3.amazonaws.com/sendgrid-java/sendgrid-java.jar)
75+
[sendgrid-java.jar](http://repo1.maven.org/maven2/com/sendgrid/sendgrid-java/3.0.0/sendgrid-java-3.0.0-jar.jar)
12176

12277
```java
12378
import com.sendgrid.*;
@@ -181,23 +136,23 @@ try {
181136
# Usage
182137

183138
- [SendGrid Docs](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html)
184-
- [Usage Docs](https://github.com/sendgrid/sendgrid-java/tree/v3beta/USAGE.md)
185-
- [Example Code](https://github.com/sendgrid/sendgrid-java/tree/v3beta/examples)
139+
- [Usage Docs](https://github.com/sendgrid/sendgrid-java/tree/master/USAGE.md)
140+
- [Example Code](https://github.com/sendgrid/sendgrid-java/tree/master/examples)
186141

187142
## Roadmap
188143

189144
If you are intersted in the future direction of this project, please take a look at our [milestones](https://github.com/sendgrid/sendgrid-java/milestones). We would love to hear your feedback.
190145

191146
## How to Contribute
192147

193-
We encourage contribution to our libraries, please see our [CONTRIBUTING](https://github.com/sendgrid/sendgrid-java/blob/v3beta/CONTRIBUTING.md) guide for details.
148+
We encourage contribution to our libraries, please see our [CONTRIBUTING](https://github.com/sendgrid/sendgrid-java/blob/master/CONTRIBUTING.md) guide for details.
194149

195150
Quick links:
196151

197-
- [Feature Request](https://github.com/sendgrid/sendgrid-java/blob/v3beta/CONTRIBUTING.md#feature_request)
198-
- [Bug Reports](https://github.com/sendgrid/sendgrid-java/blob/v3beta/CONTRIBUTING.md#submit_a_bug_report)
199-
- [Sign the CLA to Create a Pull Request](https://github.com/sendgrid/sendgrid-java/blob/v3beta/CONTRIBUTING.md#cla)
200-
- [Improvements to the Codebase](https://github.com/sendgrid/sendgrid-java/blob/v3beta/CONTRIBUTING.md#improvements_to_the_codebase)
152+
- [Feature Request](https://github.com/sendgrid/sendgrid-java/blob/master/CONTRIBUTING.md#feature_request)
153+
- [Bug Reports](https://github.com/sendgrid/sendgrid-java/blob/master/CONTRIBUTING.md#submit_a_bug_report)
154+
- [Sign the CLA to Create a Pull Request](https://github.com/sendgrid/sendgrid-java/blob/master/CONTRIBUTING.md#cla)
155+
- [Improvements to the Codebase](https://github.com/sendgrid/sendgrid-java/blob/master/CONTRIBUTING.md#improvements_to_the_codebase)
201156

202157
# About
203158

USAGE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2561,7 +2561,7 @@ More Information:
25612561
throw ex;
25622562
}
25632563
```
2564-
## v3 Mail Send Beta
2564+
## v3 Mail Send
25652565

25662566
This endpoint allows you to send email over SendGrids v3 Web API, the most recent version of our API. If you are looking for documentation about the v2 Mail Send endpoint, please see our [v2 API Reference](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).
25672567

@@ -2572,16 +2572,16 @@ For an overview of the v3 Mail Send endpoint, please visit our [v3 API Reference
25722572

25732573
For more detailed information about how to use the v3 Mail Send endpoint, please visit our [Classroom](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/index.html).
25742574

2575-
### POST /mail/send/beta
2575+
### POST /mail/send
25762576

2577-
This endpoint has a helper, check it out [here](https://github.com/sendgrid/sendgrid-java/blob/v3beta/src/main/java/com/sendgrid/helpers/README.md).
2577+
This endpoint has a helper, check it out [here](https://github.com/sendgrid/sendgrid-java/blob/master/src/main/java/com/sendgrid/helpers/README.md).
25782578

25792579
```java
25802580
try {
25812581
SendGrid sg = new SendGrid(System.getenv("SENDGRID_API_KEY"));
25822582
Request request = new Request();
25832583
request.method = Method.POST;
2584-
request.endpoint = "mail/send/beta";
2584+
request.endpoint = "mail/send";
25852585
request.body = "{\"custom_args\":{\"New Argument 1\":\"New Value 1\",\"activationAttempt\":\"1\",\"customerAccountNumber\":\"[CUSTOMER ACCOUNT NUMBER GOES HERE]\"},\"from\":{\"email\":\"sam.smith@example.com\",\"name\":\"Sam Smith\"},\"attachments\":[{\"name\":\"file1\",\"filename\":\"file1.jpg\",\"content\":\"[BASE64 encoded content block here]\",\"disposition\":\"inline\",\"content_id\":\"ii_139db99fdb5c3704\",\"type\":\"jpg\"}],\"personalizations\":[{\"to\":[{\"email\":\"john.doe@example.com\",\"name\":\"John Doe\"}],\"cc\":[{\"email\":\"jane.doe@example.com\",\"name\":\"Jane Doe\"}],\"bcc\":[{\"email\":\"sam.doe@example.com\",\"name\":\"Sam Doe\"}],\"custom_args\":{\"New Argument 1\":\"New Value 1\",\"activationAttempt\":\"1\",\"customerAccountNumber\":\"[CUSTOMER ACCOUNT NUMBER GOES HERE]\"},\"headers\":{\"X-Accept-Language\":\"en\",\"X-Mailer\":\"MyApp\"},\"send_at\":1409348513,\"substitutions\":{\"sub\":{\"%name%\":[\"John\",\"Jane\",\"Sam\"]}},\"subject\":\"Hello, World!\"}],\"subject\":\"Hello, World!\",\"ip_pool_name\":\"[YOUR POOL NAME GOES HERE]\",\"content\":[{\"type\":\"text/html\",\"value\":\"<html><p>Hello, world!</p><img src=[CID GOES HERE]></img></html>\"}],\"headers\":{},\"asm\":{\"groups_to_display\":[1,2,3],\"group_id\":1},\"batch_id\":\"[YOUR BATCH ID GOES HERE]\",\"tracking_settings\":{\"subscription_tracking\":{\"text\":\"If you would like to unsubscribe and stop receiveing these emails <% click here %>.\",\"enable\":true,\"html\":\"If you would like to unsubscribe and stop receiving these emails <% clickhere %>.\",\"substitution_tag\":\"<%click here%>\"},\"open_tracking\":{\"enable\":true,\"substitution_tag\":\"%opentrack\"},\"click_tracking\":{\"enable\":true,\"enable_text\":true},\"ganalytics\":{\"utm_campaign\":\"[NAME OF YOUR REFERRER SOURCE]\",\"enable\":true,\"utm_name\":\"[NAME OF YOUR CAMPAIGN]\",\"utm_term\":\"[IDENTIFY PAID KEYWORDS HERE]\",\"utm_content\":\"[USE THIS SPACE TO DIFFERENTIATE YOUR EMAIL FROM ADS]\",\"utm_medium\":\"[NAME OF YOUR MARKETING MEDIUM e.g. email]\"}},\"mail_settings\":{\"footer\":{\"text\":\"Thanks,/n The SendGrid Team\",\"enable\":true,\"html\":\"<p>Thanks</br>The SendGrid Team</p>\"},\"spam_check\":{\"threshold\":3,\"post_to_url\":\"http://example.com/compliance\",\"enable\":true},\"bypass_list_management\":{\"enable\":true},\"sandbox_mode\":{\"enable\":false},\"bcc\":{\"enable\":true,\"email\":\"ben.doe@example.com\"}},\"reply_to\":{\"email\":\"sam.smith@example.com\",\"name\":\"Sam Smith\"},\"sections\":{\"section\":{\":sectionName2\":\"section 2 text\",\":sectionName1\":\"section 1 text\"}},\"template_id\":\"[YOUR TEMPLATE ID GOES HERE]\",\"categories\":[\"category1\",\"category2\"],\"send_at\":1409348513}";
25862586
Response response = sg.api(request);
25872587
System.out.println(response.statusCode);

examples/mail/mail.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@ public static void main(String[] args) throws IOException {
5656
}
5757

5858
//////////////////////////////////////////////////////////////////
59-
// v3 Mail Send Beta
60-
// POST /mail/send/beta
59+
// v3 Mail Send
60+
// POST /mail/send
6161

62-
// This endpoint has a helper, check it out [here](https://github.com/sendgrid/sendgrid-java/blob/v3beta/src/main/java/com/sendgrid/helpers/README.md).
62+
// This endpoint has a helper, check it out [here](https://github.com/sendgrid/sendgrid-java/blob/master/src/main/java/com/sendgrid/helpers/README.md).
6363

6464
public class Example {
6565
public static void main(String[] args) throws IOException {
6666
try {
6767
SendGrid sg = new SendGrid(System.getenv("SENDGRID_API_KEY"));
6868
Request request = new Request();
6969
request.method = Method.POST;
70-
request.endpoint = "mail/send/beta";
70+
request.endpoint = "mail/send";
7171
request.body = "{\"custom_args\":{\"New Argument 1\":\"New Value 1\",\"activationAttempt\":\"1\",\"customerAccountNumber\":\"[CUSTOMER ACCOUNT NUMBER GOES HERE]\"},\"from\":{\"email\":\"sam.smith@example.com\",\"name\":\"Sam Smith\"},\"attachments\":[{\"name\":\"file1\",\"filename\":\"file1.jpg\",\"content\":\"[BASE64 encoded content block here]\",\"disposition\":\"inline\",\"content_id\":\"ii_139db99fdb5c3704\",\"type\":\"jpg\"}],\"personalizations\":[{\"to\":[{\"email\":\"john.doe@example.com\",\"name\":\"John Doe\"}],\"cc\":[{\"email\":\"jane.doe@example.com\",\"name\":\"Jane Doe\"}],\"bcc\":[{\"email\":\"sam.doe@example.com\",\"name\":\"Sam Doe\"}],\"custom_args\":{\"New Argument 1\":\"New Value 1\",\"activationAttempt\":\"1\",\"customerAccountNumber\":\"[CUSTOMER ACCOUNT NUMBER GOES HERE]\"},\"headers\":{\"X-Accept-Language\":\"en\",\"X-Mailer\":\"MyApp\"},\"send_at\":1409348513,\"substitutions\":{\"sub\":{\"%name%\":[\"John\",\"Jane\",\"Sam\"]}},\"subject\":\"Hello, World!\"}],\"subject\":\"Hello, World!\",\"ip_pool_name\":\"[YOUR POOL NAME GOES HERE]\",\"content\":[{\"type\":\"text/html\",\"value\":\"<html><p>Hello, world!</p><img src=[CID GOES HERE]></img></html>\"}],\"headers\":{},\"asm\":{\"groups_to_display\":[1,2,3],\"group_id\":1},\"batch_id\":\"[YOUR BATCH ID GOES HERE]\",\"tracking_settings\":{\"subscription_tracking\":{\"text\":\"If you would like to unsubscribe and stop receiveing these emails <% click here %>.\",\"enable\":true,\"html\":\"If you would like to unsubscribe and stop receiving these emails <% clickhere %>.\",\"substitution_tag\":\"<%click here%>\"},\"open_tracking\":{\"enable\":true,\"substitution_tag\":\"%opentrack\"},\"click_tracking\":{\"enable\":true,\"enable_text\":true},\"ganalytics\":{\"utm_campaign\":\"[NAME OF YOUR REFERRER SOURCE]\",\"enable\":true,\"utm_name\":\"[NAME OF YOUR CAMPAIGN]\",\"utm_term\":\"[IDENTIFY PAID KEYWORDS HERE]\",\"utm_content\":\"[USE THIS SPACE TO DIFFERENTIATE YOUR EMAIL FROM ADS]\",\"utm_medium\":\"[NAME OF YOUR MARKETING MEDIUM e.g. email]\"}},\"mail_settings\":{\"footer\":{\"text\":\"Thanks,/n The SendGrid Team\",\"enable\":true,\"html\":\"<p>Thanks</br>The SendGrid Team</p>\"},\"spam_check\":{\"threshold\":3,\"post_to_url\":\"http://example.com/compliance\",\"enable\":true},\"bypass_list_management\":{\"enable\":true},\"sandbox_mode\":{\"enable\":false},\"bcc\":{\"enable\":true,\"email\":\"ben.doe@example.com\"}},\"reply_to\":{\"email\":\"sam.smith@example.com\",\"name\":\"Sam Smith\"},\"sections\":{\"section\":{\":sectionName2\":\"section 2 text\",\":sectionName1\":\"section 1 text\"}},\"template_id\":\"[YOUR TEMPLATE ID GOES HERE]\",\"categories\":[\"category1\",\"category2\"],\"send_at\":1409348513}";
7272
Response response = sg.api(request);
7373
System.out.println(response.statusCode);

0 commit comments

Comments
 (0)