From aea23f5ee27cf251d41aa50e32ae8970999c6053 Mon Sep 17 00:00:00 2001 From: nikkel Date: Fri, 20 Mar 2020 03:15:53 +0700 Subject: [PATCH] Update 'README.md' --- README.md | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 73b48ef..4c5baad 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,39 @@ # postman-java +Java Client API for the Postman email platform (https://postman.prmail.vn) + +Currently the client supports two basic operations - Send and SendRaw - +the other API functions for accessing messages will be added at a later date. + +## Usage + +```java +PostmanService postmanService = new PostmanService("<>", "API_KEY"); + +PostmanMessage message = new PostmanMessageBuilder() + .from("no-reply@my-domain.com") + .to("email@company.com") + .cc("email@company.com") + .bcc("email@company.com") + .withSubject("Testing with attachments") + .withPlainBody("Please view this email in a modern email client!") + .withHtmlBody("

html body

Please check your attachments!

") + .withTag("tag") + .addAttachment(new Attachment("test-csv.csv", "application/octet-stream", attachmentByte)) + .build(); + +postman.sendMessage(message); +``` + +## Embedded images + +If you want to use embedded image simply add it with + +`.addEmbeddedImage(new EmbeddedImage("cidReference", "image/png", googleLogo))` + +And reference if in the html body of your email with + +`` + +You can put Base64 encoded documents for attachments and embedded image or the byte[] of your document +in the methods `addAttachment` and `addEmbeddedImage` -Java Client API for the Postal email platform \ No newline at end of file