Created
December 15, 2017 19:29
-
-
Save ethanhinson/1906e41b23dcfaa38f147dbb176b49fa to your computer and use it in GitHub Desktop.
Simple Smart Email
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Add a dependancy via Gradle: | |
dependencies { | |
compile 'createsend:createsend-java:5.1.0' | |
} | |
Or Maven: | |
<dependency> | |
<groupid>createsend-java</groupid> | |
<artifactid>createsend-java</artifactid> | |
<version>5.1.0</version> | |
</dependency> | |
*/ | |
// Authenticate with API Key | |
ApiKeyAuthenticationDetails auth = new ApiKeyAuthenticationDetails("ad69e29d4f7417b74b776d5173414e40a1680ae27da9be6f"); | |
UUID smartEmailID = UUID.fromString("8b7920f5-ef89-489e-a328-2ad90f4b300f"); | |
String toAddress = "Bluetent <[email protected]>"; | |
SmartEmail smartEmail = new SmartEmail(auth); | |
SmartEmailRequest smartEmailRequest = new SmartEmailRequest(smartEmailID, toAddress); | |
// Add mail merge variables | |
smartEmailRequest.addData("guest_name", "guest_nameTestValue"); | |
// Send the smart email | |
smartEmail.send(smartEmailRequest); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment