Skip to content

Commit c295f84

Browse files
author
Alex Malgaroli
authoredOct 10, 2019
Merge pull request #30 from ndarilek/master
Add support for parameters needed to send emails.
2 parents c740ac9 + 920dc9f commit c295f84

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed
 

‎src/main/java/com/currencyfair/onesignal/model/notification/Notification.java

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,37 @@ public class Notification {
251251
@JsonProperty("chrome_big_picture")
252252
private String chromeBigPicture;
253253

254+
/**
255+
* The subject of the email.
256+
* <p> Required for email notifications.
257+
*/
258+
@JsonProperty("email_subject")
259+
private String emailSubject;
260+
261+
/**
262+
* The body of the email. (HTML supported)
263+
* <p> Required for email notifications.
264+
*/
265+
@JsonProperty("email_body")
266+
private String emailBody;
267+
268+
/**
269+
* The name the email is from.
270+
* <p> If this is not specified, this will use your default from
271+
* name set in Email Setup.
272+
*/
273+
@JsonProperty("email_from_name")
274+
private String emailFromName;
275+
276+
/**
277+
* Valid email address.
278+
* <p> The email address the email is from. If this is not specified, this will use your
279+
* default from email in Email Setup.
280+
*/
281+
@JsonProperty("email_from_address")
282+
private String emailFromAddress;
283+
284+
254285

255286

256287
// ACTION BUTTONS
@@ -1189,6 +1220,22 @@ public void setChrome(Boolean chrome) {
11891220
this.chrome = chrome;
11901221
}
11911222

1223+
public void setEmailSubject(String subject) {
1224+
this.emailSubject = subject;
1225+
}
1226+
1227+
public void setEmailBody(String body) {
1228+
this.emailBody = body;
1229+
}
1230+
1231+
public void setEmailFromName(String name) {
1232+
this.emailFromName = name;
1233+
}
1234+
1235+
public void setEmailFromAddress(String address) {
1236+
this.emailFromAddress = address;
1237+
}
1238+
11921239
@Override
11931240
public String toString() {
11941241
return ToStringBuilder.reflectionToString(this);

‎src/main/java/com/currencyfair/onesignal/model/notification/NotificationRequestBuilder.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ public final class NotificationRequestBuilder {
9292
private Boolean wpwns;
9393
private Boolean adm;
9494
private Boolean chrome;
95+
private String emailSubject;
96+
private String emailBody;
97+
private String emailFromName;
98+
private String emailFromAddress;
9599

96100
private NotificationRequestBuilder() {
97101
}
@@ -518,6 +522,26 @@ public NotificationRequestBuilder withChrome(Boolean chrome) {
518522
return this;
519523
}
520524

525+
public NotificationRequestBuilder withEmailSubject(String subject) {
526+
this.emailSubject = subject;
527+
return this;
528+
}
529+
530+
public NotificationRequestBuilder withEmailBody(String body) {
531+
this.emailBody = body;
532+
return this;
533+
}
534+
535+
public NotificationRequestBuilder withEmailFromName(String name) {
536+
this.emailFromName = name;
537+
return this;
538+
}
539+
540+
public NotificationRequestBuilder withEmailFromAddress(String address) {
541+
this.emailFromAddress = address;
542+
return this;
543+
}
544+
521545
public NotificationRequest build() {
522546
NotificationRequest notificationRequest = new NotificationRequest();
523547
notificationRequest.setId(id);
@@ -585,6 +609,10 @@ public NotificationRequest build() {
585609
notificationRequest.setWpwns(wpwns);
586610
notificationRequest.setAdm(adm);
587611
notificationRequest.setChrome(chrome);
612+
notificationRequest.setEmailSubject(emailSubject);
613+
notificationRequest.setEmailBody(emailBody);
614+
notificationRequest.setEmailFromName(emailFromName);
615+
notificationRequest.setEmailFromAddress(emailFromAddress);
588616
return notificationRequest;
589617
}
590618
}

0 commit comments

Comments
 (0)