Skip to content

Commit

Permalink
Merge pull request #30 from ndarilek/master
Browse files Browse the repository at this point in the history
Add support for parameters needed to send emails.
  • Loading branch information
Alex Malgaroli authored Oct 10, 2019
2 parents c740ac9 + 920dc9f commit c295f84
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,37 @@ public class Notification {
@JsonProperty("chrome_big_picture")
private String chromeBigPicture;

/**
* The subject of the email.
* <p> Required for email notifications.
*/
@JsonProperty("email_subject")
private String emailSubject;

/**
* The body of the email. (HTML supported)
* <p> Required for email notifications.
*/
@JsonProperty("email_body")
private String emailBody;

/**
* The name the email is from.
* <p> If this is not specified, this will use your default from
* name set in Email Setup.
*/
@JsonProperty("email_from_name")
private String emailFromName;

/**
* Valid email address.
* <p> The email address the email is from. If this is not specified, this will use your
* default from email in Email Setup.
*/
@JsonProperty("email_from_address")
private String emailFromAddress;




// ACTION BUTTONS
Expand Down Expand Up @@ -1189,6 +1220,22 @@ public void setChrome(Boolean chrome) {
this.chrome = chrome;
}

public void setEmailSubject(String subject) {
this.emailSubject = subject;
}

public void setEmailBody(String body) {
this.emailBody = body;
}

public void setEmailFromName(String name) {
this.emailFromName = name;
}

public void setEmailFromAddress(String address) {
this.emailFromAddress = address;
}

@Override
public String toString() {
return ToStringBuilder.reflectionToString(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ public final class NotificationRequestBuilder {
private Boolean wpwns;
private Boolean adm;
private Boolean chrome;
private String emailSubject;
private String emailBody;
private String emailFromName;
private String emailFromAddress;

private NotificationRequestBuilder() {
}
Expand Down Expand Up @@ -518,6 +522,26 @@ public NotificationRequestBuilder withChrome(Boolean chrome) {
return this;
}

public NotificationRequestBuilder withEmailSubject(String subject) {
this.emailSubject = subject;
return this;
}

public NotificationRequestBuilder withEmailBody(String body) {
this.emailBody = body;
return this;
}

public NotificationRequestBuilder withEmailFromName(String name) {
this.emailFromName = name;
return this;
}

public NotificationRequestBuilder withEmailFromAddress(String address) {
this.emailFromAddress = address;
return this;
}

public NotificationRequest build() {
NotificationRequest notificationRequest = new NotificationRequest();
notificationRequest.setId(id);
Expand Down Expand Up @@ -585,6 +609,10 @@ public NotificationRequest build() {
notificationRequest.setWpwns(wpwns);
notificationRequest.setAdm(adm);
notificationRequest.setChrome(chrome);
notificationRequest.setEmailSubject(emailSubject);
notificationRequest.setEmailBody(emailBody);
notificationRequest.setEmailFromName(emailFromName);
notificationRequest.setEmailFromAddress(emailFromAddress);
return notificationRequest;
}
}

0 comments on commit c295f84

Please sign in to comment.