Skip to content

Commit 23f7c40

Browse files
authored
Merge branch 'master' into fix-java-packages
2 parents ac1a990 + 96655f3 commit 23f7c40

File tree

118 files changed

+4462
-2922
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+4462
-2922
lines changed

.codeclimate.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
plugins:
3+
checkstyle:
4+
enabled: true
5+
fixme:
6+
enabled: true
7+
pmd:
8+
enabled: true

.env_sample

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export SENDGRID_API_KEY=''

.github/PULL_REQUEST_TEMPLATE

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!--
2+
We appreciate the effort for this pull request but before that please make sure you read the contribution guidelines given above, then fill out the blanks below.
3+
4+
5+
Please enter each Issue number you are resolving in your PR after one of the following words [Fixes, Closes, Resolves]. This will auto-link these issues and close them when this PR is merged!
6+
e.g.
7+
Fixes #1
8+
Closes #2
9+
-->
10+
# Fixes #
11+
12+
### Checklist
13+
- [ ] I have made a material change to the repo (functionality, testing, spelling, grammar)
14+
- [ ] I have read the [Contribution Guide] and my PR follows them.
15+
- [ ] I updated my branch with the master branch.
16+
- [ ] I have added tests that prove my fix is effective or that my feature works
17+
- [ ] I have added necessary documentation about the functionality in the appropriate .md file
18+
- [ ] I have added in line documentation to the code I modified
19+
20+
### Short description of what this PR does:
21+
-
22+
-
23+
24+
If you have questions, please send an email to [Sendgrid](mailto:[email protected]), or file a Github Issue in this repository.

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ target
1212
examples/Example.java
1313
.settings
1414
.classpath
15-
.project
15+
.project
16+
.env
17+
.vscode

.travis.yml

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
11
language: java
2-
sudo: false
32
matrix:
43
include:
5-
- os: linux
6-
dist: precise
7-
jdk: openjdk7
8-
- os: linux
9-
dist: precise
10-
jdk: oraclejdk7
11-
- os: linux
12-
jdk: oraclejdk8
4+
- jdk: openjdk8
5+
- jdk: oraclejdk8
136
before_script:
147
- "./scripts/startPrism.sh &"
15-
- sleep 10
8+
- sleep 20
169
before_install:
17-
- cat /etc/hosts # optionally check the content *before*
18-
- sudo hostname "$(hostname | cut -c1-63)"
19-
- sed -e "s/^\\(127\\.0\\.0\\.1.*\\)/\\1 $(hostname | cut -c1-63)/" /etc/hosts | sudo tee /etc/hosts
20-
- cat /etc/hosts # optionally check the content *after*
10+
- cat /etc/hosts # optionally check the content *before*
11+
- sudo hostname "$(hostname | cut -c1-63)"
12+
- sed -e "s/^\\(127\\.0\\.0\\.1.*\\)/\\1 $(hostname | cut -c1-63)/" /etc/hosts > /tmp/hosts
13+
- sudo mv /tmp/hosts /etc/hosts
14+
- cat /etc/hosts # optionally check the content *after*
2115
after_script:
22-
- lsof -i :4010 -S # adds some debugging statements
23-
- "./gradlew build"
24-
- "./scripts/upload.sh"
16+
- lsof -i :4010 -S # adds some debugging statements
17+
- "./gradlew build"
18+
- "./scripts/upload.sh"
2519
env:
2620
global:
2721
- S3_POLICY: ewogICJleHBpcmF0aW9uIjogIjIxMDAtMDEtMDFUMTI6MDA6MDAuMDAwWiIsCiAgImNvbmRpdGlvbnMiOiBbCiAgICB7ImFjbCI6ICJwdWJsaWMtcmVhZCIgfSwKICAgIHsiYnVja2V0IjogInNlbmRncmlkLW9wZW4tc291cmNlIiB9LAogICAgWyJzdGFydHMtd2l0aCIsICIka2V5IiwgInNlbmRncmlkLWphdmEvIl0sCiAgICBbImNvbnRlbnQtbGVuZ3RoLXJhbmdlIiwgMjA0OCwgMjY4NDM1NDU2XSwKICAgIFsiZXEiLCAiJENvbnRlbnQtVHlwZSIsICJhcHBsaWNhdGlvbi96aXAiXQogIF0KfQo=

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,35 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4+
## [4.2.1] - 2018-05-08
5+
### Security Fix
6+
- Update to latest Jackson recommended dependency, based on [this article](https://medium.com/@cowtowncoder/on-jackson-cves-dont-panic-here-is-what-you-need-to-know-54cd0d6e8062).
7+
8+
## [4.2.0] - 2018-05-04
9+
### Added
10+
- [PR #275](https://github.com/sendgrid/sendgrid-java/pull/275/files): Add a way to verify that the content doesn't contain sensitive information -- BIG thanks to [Diego Camargo](https://github.com/belfazt)
11+
- [PR #249](https://github.com/sendgrid/sendgrid-java/pull/249): Add optional rate limit support -- BIG thanks to [Andy Trimble](https://github.com/andy-trimble)
12+
- [PR #379](https://github.com/sendgrid/sendgrid-java/pull/379): Break up the examples in examples/subusers/subusers.java to their own files -- BIG thanks to [huytranrjc](https://github.com/huytranrjc)
13+
- [PR #365](https://github.com/sendgrid/sendgrid-java/pull/365): Test to check year in license file -- BIG thanks to [Alex](https://github.com/pushkyn)
14+
- [PR #345](https://github.com/sendgrid/sendgrid-java/pull/345): Add .codeclimate.yml file -- BIG thanks to [Rostyslav Zatserkovnyi](https://github.com/rzats)
15+
- [PR #319](https://github.com/sendgrid/sendgrid-java/pull/319): Add .env_sample file -- BIG thanks to [Thiago Barbato](https://github.com/thiagobbt)
16+
- [PR #223](https://github.com/sendgrid/sendgrid-java/pull/223): The license file is now in the release jar -- BIG thanks to [sccalabr](https://github.com/sccalabr)
17+
- [PR #224](https://github.com/sendgrid/sendgrid-java/pull/224): Adding SendGridApi interface -- BIG thanks to [sccalabr](https://github.com/sccalabr)
18+
19+
### Fix
20+
- [PR #410](https://github.com/sendgrid/sendgrid-java/pull/410): Update Jackson dependencies to the latest version -- BIG thanks to [Dmitry Avershin](https://github.com/dmitraver)
21+
- [PR #380](https://github.com/sendgrid/sendgrid-java/pull/380): Fix "similar-code" issue in examples/whitelabel/ips.java -- BIG thanks to [huytranrjc](https://github.com/huytranrjc)
22+
- [PR #255](https://github.com/sendgrid/sendgrid-java/pull/225): Fix Mail deserialization issue -- BIG thanks to [sccalabr](https://github.com/sccalabr)
23+
- [PR #359](https://github.com/sendgrid/sendgrid-java/pull/359): Fix code issue in examples/suppression/suppression.java -- BIG thanks to [Alex](https://github.com/pushkyn)
24+
- [PR #228](https://github.com/sendgrid/sendgrid-java/pull/228): Changes serialization type from default to non-empty -- BIG thanks to [Dmitry Avershin](https://github.com/dmitraver)
25+
- [PR #373](https://github.com/sendgrid/sendgrid-java/pull/373): Fix file_lines issue in examples/mailsettings/mailsettings.java -- BIG thanks to [Mithun Sasidharan](https://github.com/mithunsasidharan)
26+
27+
28+
## [4.1.2] - 2017-10-30
29+
### Added
30+
- PR #220 Alway serialize click-tracking parameters.
31+
- BIG thanks to [Mattia Barbon](https://github.com/mbarbon)
32+
433
## [4.1.1] - 2017-10-10
534
### Added
635
- PR #247 Added Javadocs.

CONTRIBUTING.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ touch Example.java
102102
Add the example you want to test to Example.java, including the headers at the top of the file.
103103

104104
``` bash
105-
javac -classpath ../repo/com/sendgrid/4.1.1/sendgrid-4.1.0-jar.jar:. Example.java && java -classpath ../repo/com/sendgrid/4.1.0/sendgrid-4.1.1-jar.jar:. Example
105+
javac -classpath ../repo/com/sendgrid/4.2.1/sendgrid-4.2.1-jar.jar:. Example.java && java -classpath ../repo/com/sendgrid/4.2.1/sendgrid-4.2.1-jar.jar:. Example
106106
```
107107

108108
<a name="understanding-the-codebase"></a>
@@ -129,7 +129,7 @@ All test files are in the [`tests`](https://github.com/sendgrid/sendgrid-java/tr
129129

130130
For the purposes of contributing to this repo, please update the [`SendGridTest.java`](https://github.com/sendgrid/sendgrid-java/tree/master/src/test/java/com/sendgrid/SendGridTest.java) file with unit tests as you modify the code.
131131

132-
1. Download [prism](https://stoplight.io/prism/) for your platform ([Mac OS X](https://github.com/stoplightio/prism/releases/download/v0.1.5/prism_darwin_amd64)) and save the binary to the sendgrid-ruby directory (or any directory you would like. The sendgrid-ruby directory is chosen mostly for convenience.)
132+
1. Download [prism](http://stoplight.io/platform/prism/) for your platform ([Mac OS X](https://github.com/stoplightio/prism/releases/download/v0.6.21/prism_darwin_amd64), [Linux](https://github.com/stoplightio/prism/releases/download/v0.6.21/prism_linux_amd64), [Windows](https://github.com/stoplightio/prism/releases/download/v0.6.21/prism_windows_amd64.exe)) and save the binary to the sendgrid-java directory (or any directory you would like. The sendgrid-java directory is chosen mostly for convenience.)
133133

134134
1. Add execute permissions
135135

@@ -168,8 +168,10 @@ Please run your code through:
168168
```bash
169169
# Clone your fork of the repo into the current directory
170170
git clone https://github.com/sendgrid/sendgrid-java
171+
171172
# Navigate to the newly cloned directory
172173
cd sendgrid-java
174+
173175
# Assign the original repo to a remote called "upstream"
174176
git remote add upstream https://github.com/sendgrid/sendgrid-java
175177
```

LICENSE.txt renamed to LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2013-2016 SendGrid
3+
Copyright (c) 2013-2018 SendGrid, Inc.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
[![Email Notifications Badge](https://dx.sendgrid.com/badge/java)](https://dx.sendgrid.com/newsletter/java)
66
[![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)
77
[![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/sendgrid-java.svg)](https://github.com/sendgrid/sendgrid-java/graphs/contributors)
8+
[![Open Source Helpers](https://www.codetriage.com/sendgrid/sendgrid-java/badges/users.svg)](https://www.codetriage.com/sendgrid/sendgrid-java)
89
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.txt)
910

1011
**NEW:** Subscribe to email [notifications](https://dx.sendgrid.com/newsletter/java) for releases and breaking changes.
@@ -15,7 +16,7 @@ Version 3.X.X of this library provides full support for all SendGrid [Web API v3
1516

1617
This library represents the beginning of a new path for SendGrid. We want this library to be community driven and SendGrid led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create [issues](https://github.com/sendgrid/sendgrid-java/issues) and [pull requests](https://github.com/sendgrid/sendgrid-java/blob/master/CONTRIBUTING.md) or simply upvote or comment on existing issues or pull requests.
1718

18-
Please browse the rest of this README for further detail.
19+
Please browse the rest of this README for further details.
1920

2021
We appreciate your continued support, thank you!
2122

@@ -44,11 +45,16 @@ We appreciate your continued support, thank you!
4445

4546
Update the development environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys), for example:
4647

48+
1. Copy the sample environment file to a new file
4749
```bash
48-
echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
49-
echo "sendgrid.env" >> .gitignore
50-
source ./sendgrid.env
50+
cp .env_sample .env
5151
```
52+
2. Edit the new `.env` to add your API key
53+
3. Source the `.env` file to set rhe variable in the current session
54+
```bash
55+
source .env
56+
```
57+
5258
## Install Package
5359

5460
Choose your installation method - Maven w/ Gradle (recommended), Maven or Jar file.
@@ -61,7 +67,7 @@ Add the following to your build.gradle file in the root of your project.
6167
...
6268
dependencies {
6369
...
64-
compile 'com.sendgrid:sendgrid-java:4.1.1'
70+
compile 'com.sendgrid:sendgrid-java:4.2.1'
6571
}
6672
6773
repositories {
@@ -80,7 +86,7 @@ mvn install
8086

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

83-
[sendgrid-java-latest.jar](http://dx.sendgrid.com/downloads/sendgrid-java/sendgrid-java-latest.jar)
89+
[sendgrid-java.jar](https://github.com/sendgrid/sendgrid-java/releases/download/v4.2.1/sendgrid-java.jar)
8490

8591
## Dependencies
8692

USAGE.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ The API Keys feature allows customers to be able to generate an API Key credenti
533533

534534
Suppression groups, or unsubscribe groups, are specific types or categories of email that you would like your recipients to be able to unsubscribe from. For example: Daily Newsletters, Invoices, System Alerts.
535535

536-
The **name** and **description** of the unsubscribe group will be visible by recipients when they are managing their subscriptions.
536+
The **name** and **description** of the unsubscribe group will be visible to recipients when they are managing their subscriptions.
537537

538538
Each user can create up to 25 different suppression groups.
539539

@@ -589,7 +589,7 @@ Suppression groups, or [unsubscribe groups](https://sendgrid.com/docs/API_Refere
589589

590590
Suppression groups, or unsubscribe groups, are specific types or categories of email that you would like your recipients to be able to unsubscribe from. For example: Daily Newsletters, Invoices, System Alerts.
591591

592-
The **name** and **description** of the unsubscribe group will be visible by recipients when they are managing their subscriptions.
592+
The **name** and **description** of the unsubscribe group will be visible to recipients when they are managing their subscriptions.
593593

594594
Each user can create up to 25 different suppression groups.
595595

@@ -617,7 +617,7 @@ Each user can create up to 25 different suppression groups.
617617

618618
Suppression groups, or unsubscribe groups, are specific types or categories of email that you would like your recipients to be able to unsubscribe from. For example: Daily Newsletters, Invoices, System Alerts.
619619

620-
The **name** and **description** of the unsubscribe group will be visible by recipients when they are managing their subscriptions.
620+
The **name** and **description** of the unsubscribe group will be visible to recipients when they are managing their subscriptions.
621621

622622
Each user can create up to 25 different suppression groups.
623623

@@ -646,7 +646,7 @@ You can only delete groups that have not been attached to sent mail in the last
646646

647647
Suppression groups, or unsubscribe groups, are specific types or categories of email that you would like your recipients to be able to unsubscribe from. For example: Daily Newsletters, Invoices, System Alerts.
648648

649-
The **name** and **description** of the unsubscribe group will be visible by recipients when they are managing their subscriptions.
649+
The **name** and **description** of the unsubscribe group will be visible to recipients when they are managing their subscriptions.
650650

651651
Each user can create up to 25 different suppression groups.
652652

@@ -5672,7 +5672,7 @@ For more information on whitelabeling, please see our [User Guide](https://sendg
56725672
56735673
A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record.
56745674
5675-
Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The the parent may then associate the whitelabel via the subuser management tools.
5675+
Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The parent may then associate the whitelabel via the subuser management tools.
56765676

56775677
For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)
56785678

@@ -5704,7 +5704,7 @@ For more information on whitelabeling, please see our [User Guide](https://sendg
57045704

57055705
A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record.
57065706

5707-
Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The the parent may then associate the whitelabel via the subuser management tools.
5707+
Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The parent may then associate the whitelabel via the subuser management tools.
57085708
57095709
For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)
57105710
@@ -5813,7 +5813,7 @@ For more information on whitelabeling, please see our [User Guide](https://sendg
58135813
58145814
A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record.
58155815
5816-
Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The the parent may then associate the whitelabel via the subuser management tools.
5816+
Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The parent may then associate the whitelabel via the subuser management tools.
58175817

58185818
For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html)
58195819

0 commit comments

Comments
 (0)