Skip to content

Commit

Permalink
fix: Fix wrong reference to reply_to attribute (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
kewynakshlley authored Jan 16, 2024
1 parent 4b66bf0 commit e22a3b5
Showing 1 changed file with 27 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;

/**
* Represents a request to send an email.
Expand Down Expand Up @@ -204,9 +201,7 @@ public Builder to(String... recipients) {
if (this.to == null) {
this.to = new ArrayList<>();
}
for (String recipient : recipients) {
this.to.add(recipient);
}
this.to.addAll(Arrays.asList(recipients));
return this;
}

Expand Down Expand Up @@ -267,9 +262,7 @@ public Builder cc(String... recipients) {
if (this.cc == null) {
this.cc = new ArrayList<>();
}
for (String recipient : recipients) {
this.cc.add(recipient);
}
this.cc.addAll(Arrays.asList(recipients));
return this;
}

Expand All @@ -280,7 +273,10 @@ public Builder cc(String... recipients) {
* @return This builder instance for method chaining.
*/
public Builder cc(List<String> cc) {
this.cc = cc;
if (this.cc == null) {
this.cc = new ArrayList<>();
}
this.cc.addAll(cc);
return this;
}

Expand Down Expand Up @@ -309,9 +305,7 @@ public Builder bcc(String... recipients) {
if (this.bcc == null) {
this.bcc = new ArrayList<>();
}
for (String recipient : recipients) {
this.bcc.add(recipient);
}
this.bcc.addAll(Arrays.asList(recipients));
return this;
}

Expand All @@ -322,7 +316,12 @@ public Builder bcc(String... recipients) {
* @return This builder instance for method chaining.
*/
public Builder bcc(List<String> recipients) {
this.bcc = recipients;
if (this.bcc == null) {
this.bcc = new ArrayList<>();
}

this.bcc.addAll(recipients);

return this;
}

Expand Down Expand Up @@ -350,9 +349,7 @@ public Builder replyTo(String... recipients) {
if (this.replyTo == null) {
this.replyTo = new ArrayList<>();
}
for (String recipient : recipients) {
this.replyTo.add(recipient);
}
this.replyTo.addAll(Arrays.asList(recipients));
return this;
}

Expand All @@ -363,7 +360,12 @@ public Builder replyTo(String... recipients) {
* @return This builder instance for method chaining.
*/
public Builder replyTo(List<String> recipients) {
this.replyTo = replyTo;
if (this.replyTo == null) {
this.replyTo = new ArrayList<>();
}

this.replyTo.addAll(recipients);

return this;
}

Expand Down Expand Up @@ -429,9 +431,9 @@ public Builder attachments(Attachment... attachments) {
if (this.attachments == null) {
this.attachments = new ArrayList<>();
}
for (Attachment attachment : attachments) {
this.attachments.add(attachment);
}

this.attachments.addAll(Arrays.asList(attachments));

return this;
}

Expand Down Expand Up @@ -470,9 +472,9 @@ public Builder tags(Tag... tags) {
if (this.tags == null) {
this.tags = new ArrayList<>();
}
for (Tag tag : tags) {
this.tags.add(tag);
}

this.tags.addAll(Arrays.asList(tags));

return this;
}

Expand Down

0 comments on commit e22a3b5

Please sign in to comment.