@@ -11,7 +11,7 @@ For more information about SendGrid, see their
11
11
12
12
[ sample-docs ] : https://cloud.google.com/compute/docs/tutorials/sending-mail/using-sendgrid
13
13
14
- ## Running on Compute Engine
14
+ ## Running on Compute Engine
15
15
16
16
To run the sample, you will need to do the following:
17
17
@@ -20,17 +20,30 @@ To run the sample, you will need to do the following:
20
20
1 . Create a compute instance on the Google Cloud Platform Developer's Console
21
21
1 . SSH into the instance you created
22
22
1 . Update packages and install required packages
23
- sudo apt-get update && sudo apt-get install git-core openjdk-8-jdk maven
23
+
24
+ sudo apt-get update && sudo apt-get install git-core openjdk-8-jdk maven
25
+
24
26
1 . Clone the repo
25
- git clone https://github.com/GoogleCloudPlatform/java-docs-samples.git
26
- 1 . Configure your SendGrid settings in the java class (SENDGRID_API_KEY, SENDGRID_SENDER, TO_EMAIL)
27
- java-docs-samples/compute/sendgrid/src/main/java/com/example/compute/sendgrid/SendEmailServlet.java
28
- 1 . Navigate back to ./sendgrid and use maven to package the class as a jar
29
- mvn clean package
27
+
28
+ git clone https://github.com/GoogleCloudPlatform/java-docs-samples.git
29
+
30
+ 1 . Configure your SendGrid settings in the java class (` SENDGRID_API_KEY ` ,
31
+ ` SENDGRID_SENDER ` , ` TO_EMAIL ` )
32
+
33
+ java-docs-samples/compute/sendgrid/src/main/java/com/example/compute/sendgrid/SendEmailServlet.java
34
+
35
+ 1 . Navigate back to ` ./sendgrid ` and use maven to package the class as a jar
36
+
37
+ mvn clean package
38
+
30
39
1 . Switch to the target directory with the jar file and enable execution on that file
31
- chmod +x compute-sendgrid-1.0-SNAPSHOT-jar-with-dependencies.jar
40
+
41
+ chmod +x compute-sendgrid-1.0-SNAPSHOT-jar-with-dependencies.jar
42
+
32
43
1 . Make sure that openjdk 8 is the selected java version
33
- sudo update-alternatives --config java
44
+
45
+ sudo update-alternatives --config java
46
+
34
47
1 . Execute the jar file and send an email (make sure you are in the target folder)
35
- java -jar compute-sendgrid-1.0-SNAPSHOT-jar-with-dependencies.jar
36
48
49
+ java -jar compute-sendgrid-1.0-SNAPSHOT-jar-with-dependencies.jar
0 commit comments