File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ buildscript {
4545}
4646
4747dependencies {
48- compile ' com.sendgrid:java-http-client:2.1.0 '
48+ compile ' com.sendgrid:java-http-client:2.2.1 '
4949 compile ' com.fasterxml.jackson.core:jackson-core:2.5.3'
5050 compile ' com.fasterxml.jackson.core:jackson-annotations:2.5.3'
5151 compile ' com.fasterxml.jackson.core:jackson-databind:2.5.3'
Original file line number Diff line number Diff line change 8989 <dependency >
9090 <groupId >com.sendgrid</groupId >
9191 <artifactId >java-http-client</artifactId >
92- <version >2.1.0 </version >
92+ <version >2.2.1 </version >
9393 </dependency >
9494 <dependency >
9595 <groupId >com.fasterxml.jackson.core</groupId >
Original file line number Diff line number Diff line change @@ -26,10 +26,22 @@ public class SendGrid {
2626 * @param apiKey is your SendGrid API Key: https://app.sendgrid.com/settings/api_keys
2727 */
2828 public SendGrid (String apiKey ) {
29+ this .client = new Client ();
30+ initializeSendGrid (apiKey );
31+ }
32+
33+ /**
34+ * @param apiKey is your SendGrid API Key: https://app.sendgrid.com/settings/api_keys
35+ */
36+ public SendGrid (String apiKey , Boolean test ) {
37+ this .client = new Client (test );
38+ initializeSendGrid (apiKey );
39+ }
40+
41+ public void initializeSendGrid (String apiKey ) {
2942 this .apiKey = apiKey ;
3043 this .host = "api.sendgrid.com" ;
3144 this .version = "v3" ;
32- this .client = new Client ();
3345 this .requestHeaders = new HashMap <String , String >();
3446 this .requestHeaders .put ("Authorization" , "Bearer " + apiKey );
3547 this .requestHeaders .put ("Content-Type" , "application/json" );
You can’t perform that action at this time.
0 commit comments