Skip to content

Commit ae18ce7

Browse files
committed
Merge branch 'master' of github.com:sendgrid/sendgrid-java into rate_limit
2 parents 6286caa + 2110e54 commit ae18ce7

File tree

69 files changed

+2613
-1902
lines changed

Some content is hidden

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

69 files changed

+2613
-1902
lines changed

.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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ target
1212
examples/Example.java
1313
.settings
1414
.classpath
15-
.project
15+
.project
16+
.env

.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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4+
## [4.1.2] - 2017-10-30
5+
### Added
6+
- PR #220 Alway serialize click-tracking parameters.
7+
- BIG thanks to [Mattia Barbon](https://github.com/mbarbon)
8+
49
## [4.1.1] - 2017-10-10
510
### Added
611
- PR #247 Added Javadocs.

CONTRIBUTING.md

Lines changed: 2 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.1.2/sendgrid-4.1.2-jar.jar:. Example.java && java -classpath ../repo/com/sendgrid/4.1.2/sendgrid-4.1.2-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

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-2017 SendGrid
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: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Version 3.X.X of this library provides full support for all SendGrid [Web API v3
1515

1616
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.
1717

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

2020
We appreciate your continued support, thank you!
2121

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

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

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

5459
Choose your installation method - Maven w/ Gradle (recommended), Maven or Jar file.
@@ -61,7 +66,7 @@ Add the following to your build.gradle file in the root of your project.
6166
...
6267
dependencies {
6368
...
64-
compile 'com.sendgrid:sendgrid-java:4.1.1'
69+
compile 'com.sendgrid:sendgrid-java:4.1.2'
6570
}
6671
6772
repositories {

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

USE_CASES.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ This documentation provides examples for specific use cases. Please [open an iss
22

33
# Table of Contents
44

5-
* [Transactional Templates](#transactional-templates)
5+
* [Transactional Templates](#transactional_templates)
6+
* [How to Setup a Domain Whitelabel](#domain_whitelabel)
7+
* [How to View Email Statistics](#email_stats)
68

79
<a name="transactional-templates"></a>
810
# Transactional Templates
@@ -99,3 +101,18 @@ public class Example {
99101
}
100102
}
101103
```
104+
105+
<a name="domain_whitelabel"></a>
106+
# How to Setup a Domain Whitelabel
107+
108+
You can find documentation for how to setup a domain whitelabel via the UI [here](https://sendgrid.com/docs/Classroom/Basics/Whitelabel/setup_domain_whitelabel.html) and via API [here](https://github.com/sendgrid/sendgrid-java/blob/master/USAGE.md#whitelabel).
109+
110+
Find more information about all of SendGrid's whitelabeling related documentation [here](https://sendgrid.com/docs/Classroom/Basics/Whitelabel/index.html).
111+
112+
<a name="email_stats"></a>
113+
# How to View Email Statistics
114+
115+
You can find documentation for how to view your email statistics via the UI [here](https://app.sendgrid.com/statistics) and via API [here](https://github.com/sendgrid/sendgrid-java/blob/master/USAGE.md#stats).
116+
117+
Alternatively, we can post events to a URL of your choice via our [Event Webhook](https://sendgrid.com/docs/API_Reference/Webhooks/event.html) about events that occur as SendGrid processes your email.
118+

0 commit comments

Comments
 (0)