Skip to content

Commit 775328b

Browse files
author
Shun Fan
committed
Add licenses to mailjet samples
Update readme Update import order
1 parent 63f5bdc commit 775328b

File tree

7 files changed

+87
-12
lines changed

7 files changed

+87
-12
lines changed

appengine/mailjet/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Mailjet sample for Google App Engine
2-
This sample demonstrates how to use [Mailjet](https://www.mailjet.com/) on Google App Engine.
2+
This sample demonstrates how to use [Mailjet](https://www.mailjet.com/) on Google Managed VMs to
3+
send emails from a verified sender you own.
34

45
## Setup
56
1. Before using, ensure the address you plan to send from has been verified in Mailjet.

appengine/mailjet/src/main/java/com/example/appengine/mailjet/MailjetServlet.java

+20-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
1-
package com.example.appengine.mailjet;
1+
/**
2+
* Copyright 2016 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
216

3-
import org.json.JSONArray;
4-
import org.json.JSONObject;
17+
package com.example.appengine.mailjet;
518

619
import com.mailjet.client.MailjetClient;
720
import com.mailjet.client.MailjetRequest;
821
import com.mailjet.client.MailjetResponse;
922
import com.mailjet.client.errors.MailjetException;
1023
import com.mailjet.client.resource.Email;
1124

25+
import org.json.JSONArray;
26+
import org.json.JSONObject;
27+
1228
import java.io.IOException;
1329

1430
import javax.servlet.ServletException;
@@ -36,8 +52,7 @@ public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOEx
3652
"Dear passenger, welcome to Mailjet! May the delivery force be with you!")
3753
.property(Email.HTMLPART,
3854
"<h3>Dear passenger, welcome to Mailjet!</h3><br/>May the delivery force be with you!")
39-
.property(Email.RECIPIENTS,
40-
new JSONArray().put(new JSONObject().put("Email", recipient)));
55+
.property(Email.RECIPIENTS, new JSONArray().put(new JSONObject().put("Email", recipient)));
4156

4257
try {
4358
// trigger the API call

appengine/mailjet/src/main/webapp/WEB-INF/appengine-web.xml

+14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- [START_EXCLUDE] -->
3+
<!--
4+
Copyright 2015 Google Inc. All Rights Reserved.
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
14+
-->
15+
<!-- [END_EXCLUDE] -->
216
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
317
<application>YOUR-PROJECT-ID</application>
418
<version>YOUR-VERSION-ID</version>

appengine/mailjet/src/main/webapp/WEB-INF/web.xml

+14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- [START_EXCLUDE] -->
3+
<!--
4+
Copyright 2015 Google Inc. All Rights Reserved.
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
14+
-->
15+
<!-- [END_EXCLUDE] -->
216
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"
317
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
418
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

managed_vms/datastore/src/main/appengine/app.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# Copyright 2016 Google Inc. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
116
runtime: java
217
vm: true
318

managed_vms/mailjet/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Mailjet sample for Google Managed VMs
2-
This sample demonstrates how to use [Mailjet](https://www.mailjet.com/) on Google Managed VMs.
2+
This sample demonstrates how to use [Mailjet](https://www.mailjet.com/) on Google Managed VMs to
3+
send emails from a verified sender you own.
34

45
## Setup
56
1. Before using, ensure the address you plan to send from has been verified in Mailjet.

managed_vms/mailjet/src/main/java/com/example/managedvms/mailjet/MailjetServlet.java

+20-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
1-
package com.example.managedvms.mailjet;
1+
/**
2+
* Copyright 2016 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
216

3-
import org.json.JSONArray;
4-
import org.json.JSONObject;
17+
package com.example.managedvms.mailjet;
518

619
import com.mailjet.client.MailjetClient;
720
import com.mailjet.client.MailjetRequest;
821
import com.mailjet.client.MailjetResponse;
922
import com.mailjet.client.errors.MailjetException;
1023
import com.mailjet.client.resource.Email;
1124

25+
import org.json.JSONArray;
26+
import org.json.JSONObject;
27+
1228
import java.io.IOException;
1329

1430
import javax.servlet.ServletException;
@@ -38,8 +54,7 @@ public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOEx
3854
"Dear passenger, welcome to Mailjet! May the delivery force be with you!")
3955
.property(Email.HTMLPART,
4056
"<h3>Dear passenger, welcome to Mailjet!</h3><br/>May the delivery force be with you!")
41-
.property(Email.RECIPIENTS,
42-
new JSONArray().put(new JSONObject().put("Email", recipient)));
57+
.property(Email.RECIPIENTS, new JSONArray().put(new JSONObject().put("Email", recipient)));
4358

4459
try {
4560
// trigger the API call

0 commit comments

Comments
 (0)