Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spotless {
}

group = "com.nuntly"
version = "1.0.0-alpha.17"
version = "1.0.0-alpha.18"

mavenPublishing {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, automaticRelease = true)
Expand Down
2 changes: 1 addition & 1 deletion sdk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spotless {
}

group = "com.nuntly"
version = "1.0.0-alpha.17"
version = "1.0.0-alpha.18"

mavenPublishing {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, automaticRelease = true)
Expand Down
32 changes: 32 additions & 0 deletions sdk/src/main/java/com/nuntly/sdk/models/CreateBulkEmail.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.nuntly.sdk.models;

import java.util.List;
import java.util.Map;
import java.util.Optional;

public record CreateBulkEmail(
/** The e-mail address of the sender */
Optional<String> from,
/** The primary recipient(s) of the email */
List<String> to,
/** The carbon copy recipient(s) of the email */
List<String> cc,
/** The blind carbon copy recipient(s) of the email */
List<String> bcc,
/**
* The email address where replies should be sent. If a recipient replies, the response will go
* to this address instead of the sender's email address
*/
List<String> replyTo,
/** The subject of the e-mail */
Optional<String> subject,
/** The plaintext version of the email */
Optional<String> text,
/** The HTML version of the email */
Optional<String> html,
/** The headers to add to the email */
Map<String, String> headers,
/** The tags to add to the email */
List<Tag> tags,
/** The variables for the template */
Map<String, Object> variables) {}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.nuntly.sdk.models;

import java.util.List;
import java.util.Map;
import java.util.Optional;

/**
*
Expand All @@ -13,33 +13,33 @@
* }</pre>
*/
public record CreateBulkEmailsRequest(
/** Used as a fallback field email value if no value is present in emails */
Map<String, Object> fallback,
/** The bulk emails to send */
List<Map<String, Object>> emails) {
/** Used as a fallback field email value if no value is present in emails. */
Optional<CreateBulkFallback> fallback,
/** The bulk emails to send. */
List<CreateBulkEmail> emails) {

public static Builder builder() {
return new Builder();
}

public static final class Builder {
private Map<String, Object> fallback;
private List<Map<String, Object>> emails;
private CreateBulkFallback fallback;
private List<CreateBulkEmail> emails;

/** Used as a fallback field email value if no value is present in emails */
public Builder fallback(Map<String, Object> fallback) {
/** Used as a fallback field email value if no value is present in emails. */
public Builder fallback(CreateBulkFallback fallback) {
this.fallback = fallback;
return this;
}

/** The bulk emails to send */
public Builder emails(List<Map<String, Object>> emails) {
/** The bulk emails to send. */
public Builder emails(List<CreateBulkEmail> emails) {
this.emails = emails;
return this;
}

public CreateBulkEmailsRequest build() {
return new CreateBulkEmailsRequest(fallback, emails);
return new CreateBulkEmailsRequest(Optional.ofNullable(fallback), emails);
}
}
}
32 changes: 32 additions & 0 deletions sdk/src/main/java/com/nuntly/sdk/models/CreateBulkFallback.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.nuntly.sdk.models;

import java.util.List;
import java.util.Map;
import java.util.Optional;

public record CreateBulkFallback(
/** The e-mail address of the sender */
Optional<String> from,
/** The primary recipient(s) of the email */
List<String> to,
/** The carbon copy recipient(s) of the email */
List<String> cc,
/** The blind carbon copy recipient(s) of the email */
List<String> bcc,
/**
* The email address where replies should be sent. If a recipient replies, the response will go
* to this address instead of the sender's email address
*/
List<String> replyTo,
/** The subject of the e-mail */
Optional<String> subject,
/** The plaintext version of the email */
Optional<String> text,
/** The HTML version of the email */
Optional<String> html,
/** The headers to add to the email */
Map<String, String> headers,
/** The tags to add to the email */
List<Tag> tags,
/** The variables for the template */
Map<String, Object> variables) {}
2 changes: 1 addition & 1 deletion spring/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spotless {
}

group = "com.nuntly"
version = "1.0.0-alpha.17"
version = "1.0.0-alpha.18"

mavenPublishing {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, automaticRelease = true)
Expand Down