0

I'm using mailJetAPI v4.1.0

<dependency>
            <groupId>com.mailjet</groupId>
            <artifactId>mailjet-client</artifactId>
            <version>4.1.0</version>
        </dependency>
MailjetClient client;
        MailjetRequest request;
        MailjetResponse response;
        client = new MailjetClient("API_PUBLIC", "API_SECRET", new ClientOptions("v3.1"));
        request = new MailjetRequest(Emailv31.resource)
            .property(Emailv31.MESSAGES, new JSONArray()
                .put(new JSONObject()
                    .put(Emailv31.Message.FROM, new JSONObject()
                        .put("Email", "sender@gmail.com")
                        .put("Name", "Mailjet Pilot"))
                    .put(Emailv31.Message.TO, new JSONArray()
                        .put(new JSONObject()
                            .put("Email", "receiver@gmail.com")
                            .put("Name", "passenger 1")))
                    .put(Emailv31.Message.SUBJECT, "Your email flight plan!")
                    .put(Emailv31.Message.TEXTPART, "Dear passenger 1, welcome to Mailjet! May the delivery force be with you!")
                    .put(Emailv31.Message.HTMLPART, "<h3>Dear passenger 1, welcome to <a href=\"https://www.mailjet.com/\">Mailjet</a>!</h3><br />May the delivery force be with you!")));
        response = client.post(request);

in the response, it returns the messageId that is used to identify the message in mailJet, not the one sent to recipient. And thank you!

What the response returns :

"MessageID":1152921521282767905

What I'm expecting is this :

28c0Zc44.BAAAA-HEI1gAAAAAAAAAAAV62_8AAAAAp70AAAAAACHIeQBkYuwH@mailjet.com

0 Answers0