Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom domain tracking #64

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ public DomainDetails verifyDomainReturnPath(Integer id) throws PostmarkException
return dataHandler.fromJson(response,DomainDetails.class);
}

public DomainDetails verifyDomainCustomTracking(Integer id) throws PostmarkException, IOException {
String response = execute(HttpClient.REQUEST_TYPES.PUT, getEndpointUrl(domainsEndpoint + id + "/verifyCustomTracking"));
return dataHandler.fromJson(response,DomainDetails.class);
}

public String verifyDomainSPF(Integer id) throws PostmarkException, IOException {
return execute(HttpClient.REQUEST_TYPES.POST, getEndpointUrl(domainsEndpoint + id + "/verifySPF"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public class Domain {
private Boolean dkimVerified;
private Boolean weakDKIM;
private Boolean returnPathDomainVerified;

private Boolean customTrackingVerified;
private Integer id;

// GETTERS AND SETTERS
Expand Down Expand Up @@ -38,6 +40,14 @@ public void setDkimVerified(Boolean dkimVerified) {
this.dkimVerified = dkimVerified;
}

public Boolean getCustomTrackingVerified() {
return customTrackingVerified;
}

public void setCustomTrackingVerified(Boolean customTrackingVerified) {
this.customTrackingVerified = customTrackingVerified;
}

public Boolean getWeakDKIM() {
return weakDKIM;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ public class DomainDetails extends Domain {
private String returnPathDomain;
private String returnPathDomainCNAMEValue;

private String customTrackingDomain;

private String customTrackingDomainCNAMEValue;

// GETTERS AND SETTERS

public String getSpfHost() {
Expand Down Expand Up @@ -116,4 +120,20 @@ public void setReturnPathDomainCNAMEValue(String returnPathDomainCNAMEValue) {
this.returnPathDomainCNAMEValue = returnPathDomainCNAMEValue;
}

public String getCustomTrackingDomain() {
return customTrackingDomain;
}

public void setCustomTrackingDomain(String customTrackingDomain) {
this.customTrackingDomain = customTrackingDomain;
}

public String getCustomTrackingDomainCNAMEValue() {
return customTrackingDomainCNAMEValue;
}

public void setCustomTrackingDomainCNAMEValue(String customTrackingDomainCNAMEValue) {
this.customTrackingDomainCNAMEValue = customTrackingDomainCNAMEValue;
}

}
12 changes: 10 additions & 2 deletions src/test/java/integration/DomainTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

import java.io.IOException;

import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.*;

/**
* Created by bash on 11/14/17.
Expand Down Expand Up @@ -58,4 +57,13 @@ void verifyReturnPath() throws PostmarkException, IOException {
assertNotNull(domainDetails.getDkimTextValue());
}

@Test
void verifyDomainCustomTracking() throws PostmarkException, IOException {
Domains domains = client.getDomains(Parameters.init().build("count",6).build("offset",0));
Integer domainId = domains.getDomains().get(0).getId();
DomainDetails domainDetails = client.verifyDomainCustomTracking(domainId);
assertNotNull(domainDetails.getCustomTrackingDomainCNAMEValue());
assertFalse(domainDetails.getCustomTrackingVerified());
}

}