Skip to content

Commit 68d223e

Browse files
author
Chris Wilson
committed
Merging in changes from PR #81 - Added text field to TemplatePreviewData
1 parent 862bfff commit 68d223e

File tree

7 files changed

+38
-10
lines changed

7 files changed

+38
-10
lines changed

apps/sparkpost-documentor-app/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
<dependency>
6969
<groupId>commons-io</groupId>
7070
<artifactId>commons-io</artifactId>
71-
<version>2.5</version>
71+
<!-- <version>2.4</version> -->
7272
</dependency>
7373
<dependency>
7474
<groupId>org.json</groupId>

apps/sparkpost-javamail-app/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<dependency>
3232
<groupId>commons-io</groupId>
3333
<artifactId>commons-io</artifactId>
34-
<version>1.3.2</version>
34+
<!-- <version>1.3.2</version> -->
3535
</dependency>
3636

3737
<dependency>

apps/sparkpost-samples-app/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
<dependency>
5757
<groupId>commons-io</groupId>
5858
<artifactId>commons-io</artifactId>
59-
<version>1.3.2</version>
59+
<!-- <version>1.3.2</version> -->
6060
</dependency>
6161
<dependency>
6262
<groupId>org.json</groupId>

apps/sparkpost-samples-app/src/main/java/com/sparkpost/samples/PreviewTemplateSample.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ public static void main(String[] args) throws SparkPostException, IOException {
4242
}
4343

4444
private void runApp() throws SparkPostException, IOException {
45-
client = this.newConfiguredClient();
45+
this.client = this.newConfiguredClient();
4646
String template = this.getTemplate("richContent.html");
4747
createTemplate(template, SAMPLE_TEMPLATE_NAME);
4848
}
4949

5050
/**
5151
* Demonstrates how to store an email template in SparkPost
52-
*
52+
*
5353
* @throws SparkPostException
5454
*/
5555
public void createTemplate(String html, String name) throws SparkPostException {
@@ -62,11 +62,12 @@ public void createTemplate(String html, String name) throws SparkPostException {
6262
TemplateContentAttributes content = new TemplateContentAttributes();
6363

6464
content.setSubject("Template Test");
65-
content.setFrom(new AddressAttributes(client.getFromEmail(), "me", null));
65+
content.setFrom(new AddressAttributes(this.client.getFromEmail(), "me", null));
6666
content.setHtml(html);
67+
content.setText("Template Test Text");
6768
template.setContent(content);
6869

69-
IRestConnection connection = new RestConnection(client, getEndPoint());
70+
IRestConnection connection = new RestConnection(this.client, getEndPoint());
7071
try {
7172
TemplateCreateResponse response = ResourceTemplates.create(connection, template);
7273
String templateId = response.getResults().getId();
@@ -88,7 +89,7 @@ private void showTemplatePreview(String templateId, IRestConnection connection)
8889
saveToFile(response.getResults().getHtml(), path);
8990

9091
try {
91-
openWebpage(new URI("file://" + path));
92+
PreviewTemplateSample.openWebpage(new URI("file://" + path));
9293
} catch (URISyntaxException e) {
9394
e.printStackTrace();
9495
}

libs/sparkpost-lib/src/main/java/com/sparkpost/model/responses/TemplatePreviewResponse.java

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ public static final class TemplatePreviewData {
2222

2323
@Description(value = "", sample = {""})
2424
private String html;
25+
26+
@Description(value = "", sample = {""})
27+
private String text;
2528
}
2629

2730
@Description(value = "", sample = {""})

pom.xml

+25-1
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,30 @@
162162
</configuration>
163163
</plugin>
164164

165+
<plugin>
166+
<groupId>org.eclipse.m2e</groupId>
167+
<artifactId>lifecycle-mapping</artifactId>
168+
<version>1.0.0</version>
169+
<configuration>
170+
<lifecycleMappingMetadata>
171+
<pluginExecutions>
172+
<pluginExecution>
173+
<pluginExecutionFilter>
174+
<groupId>org.codehaus.mojo</groupId>
175+
<artifactId>findbugs-maven-plugin</artifactId>
176+
<versionRange>[3.0.2,)</versionRange>
177+
<goals>
178+
<goal>check</goal>
179+
</goals>
180+
</pluginExecutionFilter>
181+
<action>
182+
<ignore />
183+
</action>
184+
</pluginExecution>
185+
</pluginExecutions>
186+
</lifecycleMappingMetadata>
187+
</configuration>
188+
</plugin>
165189
</plugins>
166190
</pluginManagement>
167191

@@ -240,7 +264,7 @@
240264
<dependency>
241265
<groupId>org.projectlombok</groupId>
242266
<artifactId>lombok</artifactId>
243-
<version>1.16.6</version>
267+
<version>1.16.20</version>
244268
<scope>provided</scope>
245269
</dependency>
246270
<dependency>

tools/bin/setupLombok.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# This requires that you have built the project with Maven at least onece
33
#
44

5-
java -jar ~/.m2/repository/org/projectlombok/lombok/1.16.6/lombok-1.16.6.jar
5+
java -jar ~/.m2/repository/org/projectlombok/lombok/1.16.20/lombok-1.16.20.jar

0 commit comments

Comments
 (0)