rschreijer / lutung Goto Github PK
View Code? Open in Web Editor NEWLutung - A Java Mandrill API Connector
Lutung - A Java Mandrill API Connector
I have no inbound-emailing set up with Mandrill. Would be great if anyone out there could test the implemented 'inbound' functionalities.
In MandrillInboundApi.java
I am trying to integrate lutung with the Play Framework. The Play version is 2.4. The build.sbt is as below:
"com.google.code.gson" % "gson" % "2.3.1",
"org.apache.httpcomponents" % "httpclient" % "4.0-alpha4",
"commons-io" % "commons-io" % "1.3.2",
"commons-logging" % "commons-logging" % "1.1.1",
"com.mandrillapp.wrapper.lutung" % "lutung" % "0.0.4"
And the code to send mail is exactly the same as the one shown in Examples section of the repo at https://github.com/rschreijer/lutung. I am getting an Internal Server error 500. The detailed trace:
com.microtripit.mandrillapp.lutung.model.MandrillApiError: Unexpected http status in response: 500 (Internal Server Error)
at com.microtripit.mandrillapp.lutung.model.MandrillRequestDispatcher.execute(MandrillRequestDispatcher.java:64)
at com.microtripit.mandrillapp.lutung.controller.MandrillUtil.query(MandrillUtil.java:45)
at com.microtripit.mandrillapp.lutung.controller.MandrillMessagesApi.send(MandrillMessagesApi.java:99)
at com.microtripit.mandrillapp.lutung.controller.MandrillMessagesApi.send(MandrillMessagesApi.java:54)
at controllers.MongoStore.sendMandrill(MongoStore.java:63)
at router.Routes$$anonfun$routes$1$$anonfun$applyOrElse$4$$anonfun$apply
The same code is working fine when i build a normal maven java (No Play Framework)project. What am i missing here?
I see that there is a log4j.xml file in src/main/resources.
This causes the file to be included in the main artefact as deployed to maven central. However, since log4j loads log4j.xml in preference to log4j.properties, lutung effectively hijacks the logging of the (rather large, properties-file-logging based) project i'm working at.
A library should not contain logging configuration on its own. If any logging is needed for unit tests, logging configuration should go in src/test/resources.
If you add Multiple Recipient into List . When all of these recipients receive email, they should not be able to see each other's email addresses
Referring to issue #4
Metadata from /messages/search.json not mapped
Not real issue. The issue is that the code is commented out. Just uncomment your code for metadata in MandrillMessageInfo.java. It is working fine. Just remember that you have to configure your metadatas in your Mandrill account, otherwise they won't be shown or saved at all.
The messages/content.json API endpoint does not appear to be supported; please add support for this method.
After upgrading to version 0.0.8 I started to have some NPE
at line 124
of MandrillRequestDispatcher
, this is because response
is null
at this point. Is there any workaround for this or a way to debug my request in order to figure out what is going on? Many thanks.
Would be nice to make the artifact available in Maven Central as it would increase the user exposure.
This guide might help.
http://datumedge.blogspot.nl/2012/05/publishing-from-github-to-maven-central.html
Hello,
First I would thank you so much for this good work.
I am using this library to send template emails to users, I am already defined many templates in mandrill and I am just passing the handlebars tags from the api here, but for some reason the template email is received but without replacing the variables {{}} by the value that I am sending, hence the merge tags are not working, for this reason I am looking for a method to print the whole json message after sending the email so I can analyse it to see what is the problem and why the merge tags are not working.
So is there any way to print the whole json after this operation?
MandrillMessageStatus[] messageStatusReports = mandrillApi.messages().sendTemplate("test-template", template_content, message, false);
Hey,
I see the way to create template through your library, but can't find any method to send a mail with an email template name ?
Not implemented yet ?
Mandrill api reference : /messages/send-template.json
Hi
Does the library support local variables for Mandrill Templates
example
"global_merge_vars": [
{
"name": "merge1",
"content": "merge1 content"
}
],
"merge_vars": [
{
"rcpt": "[email protected]",
"vars": [
{
"name": "merge2",
"content": "merge2 content"
}
]
}
],
I used to have mail sending through http working lutung version 0.0.2-snapshot.
After a long idle time on the app, i retry sending email from my app through lutung http api again, but it now it throws internal server error.
After upgrading to the latest 0.0.5, it throws the same exception.
Here's the trace:
Exception: com.microtripit.mandrillapp.lutung.model.MandrillApiError: Unexpected http status in response: 500 (Internal Server Error)
at com.microtripit.mandrillapp.lutung.model.MandrillRequestDispatcher.execute(MandrillRequestDispatcher.java:92)
at com.microtripit.mandrillapp.lutung.controller.MandrillUtil.query(MandrillUtil.java:46)
at com.microtripit.mandrillapp.lutung.controller.MandrillMessagesApi.sendTemplate(MandrillMessagesApi.java:206)
at com.microtripit.mandrillapp.lutung.controller.MandrillMessagesApi.sendTemplate(MandrillMessagesApi.java:133)
It used to work, so it shouldnt be about the api key or something, as i havent changed the key or anything.
What might be wrong and how do i debug it ?
Here's my code :
MandrillMessage message = this.createMessage(
mailMsg.getSubject(), // the email subject / title
ADMIN_MAIL, // my email
mailMsg.getVar().getDomainName() + " Admin"
);
message.setGlobalMergeVars(this.createMergeVars(mailMsg));
message.setTo(this.createRecipients(mailMsg.getRecipients()));
message.setTags(mailMsg.getTags());
// hard code the api key here
MandrillApi mandrillApi = new MandrillApi(API_KEY);
MandrillMessageStatus[] messageStatusReports = null;
try {
messageStatusReports = mandrillApi.messages().sendTemplate(
mailMsg.getTemplate(),
null, // we got no block contents like mailchimp's templat layout
message,
false // it'll become true automatically if there're lots of recipients
);
} catch(Exception e) {
...
}
return messageStatusReports;
Thanks a lot !
Hi,
I'm working on transferring an orderline list to a template.
It seems that the list itself is well seen (it render the correct amount of order line) but it can't reach the content of them (and so the content of those line is empty).
Helas I find that case as example nowhere.
Here's the MergeVar filling code (simplified) :
ArrayList<MergeVar[]> products = new ArrayList<MergeVar[]>();
for (CartLine ol : cart.getCartLine()) {
`` ``MergeVar[] product = new MergeVar[4]; `` ``product[0] = new MergeVar("img", String.valueOf(ol.getEan())); `` ``product[1] = new MergeVar("author", "author"); `` ``product[2] = new MergeVar("bktitle", "title"); `` ``product[3] = new MergeVar("price", String.valueOf(ol.getPrice() * ol.getQuantity())); `` ``
products.add(product);
}MergeVar[] mergeValues = new MergeVar[4];
mergeValues[0] = new MergeVar("orderdate", new SimpleDateFormat("dd/MM/yyyy HH:mm").format(Calendar.getInstance().getTime()));
mergeValues[1] = new MergeVar("order", String.valueOf(15654));
mergeValues[2] = new MergeVar("total", 22.5);
mergeValues[3] = new MergeVar("products", products);...
Template :
{{#each products}}
<tr>
<td width="120"><img src="{{img}}" width="80" height="120"/></td>
<td>{{author}} - {{bktitle}}</td>
<td width="50" align="right">€{{price}}</td>
</tr>
{{/each}}
And here the result with two products
Does anyone can say where I'm wrong ?
Thanks a lot in advance,
Congrats for the API (which is good),
Sorry for my english (which is bad).
Geoffrey
I am trying to send a message trhough 'send-template.json' but what is being sent is an encoded string, how can i fix this??
{
"message": {
"to": [
{
"email": "[email protected]",
"type": "to"
}
],
"inline_css": true,
"merge_vars": [
{
"rcpt": "[email protected]",
"vars": [
{
"name": "url",
"content": "{"Parent":{"Test":"String"}}"
}
]
}
]
},
"template_content": [
{
"name": "satisfy_validation",
"content": ""
}
],
"template_name": "TemplateName",
"async": true,
"key": "-------"
}
When I send without those params, it works correctly, but if I put them I'm getting this:
ipPool = null
sentAt is a correct Date object
com.microtripit.mandrillapp.lutung.model.MandrillApiError: Unexpected http status in response: 500 (Internal Server Error)
at com.microtripit.mandrillapp.lutung.model.MandrillRequestDispatcher.execute(MandrillRequestDispatcher.java:64)
at com.microtripit.mandrillapp.lutung.controller.MandrillUtil.query(MandrillUtil.java:45)
at com.microtripit.mandrillapp.lutung.controller.MandrillMessagesApi.sendTemplate(MandrillMessagesApi.java:211)
I take a look at the apis, looks there is not support for mock send and proxy.
any plan to support these two features?
Thank you.
Reffering to this blog post:
http://blog.mandrill.com/handlebars-for-templates-and-dynamic-content.html#loops
I cannot use the library to send email with mutiple values for loops.
I even tried to send a MergeVar with the content of -
[{"value":"3", "text":"he is great"},{"value":"5", "text":"not so much"}]
and it doesn't work.
Thanks for your library , is it possible to send Image via this library ?
Hi,
I just cloned your library and was trying to test it using the sample code you've written in the Readme file for the project.
However, after putting the Mandrill API key, when I ran the application, it gave an exception javax.net.ssl.SSLPeerUnverifiedException
with the message peer not authenticated.
Here's the stacktrace for the exception —
javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at com.sun.net.ssl.internal.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:352)
at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:126)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:572)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:645)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:480)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:784)
at com.microtripit.mandrillapp.lutung.model.MandrillRequestDispatcher.execute(MandrillRequestDispatcher.java:45)
at com.microtripit.mandrillapp.lutung.controller.MandrillUtil.query(MandrillUtil.java:45)
at com.microtripit.mandrillapp.lutung.controller.MandrillMessagesApi.send(MandrillMessagesApi.java:99)
at com.microtripit.mandrillapp.lutung.controller.MandrillMessagesApi.send(MandrillMessagesApi.java:54)
at com.microtripit.mandrillapp.lutung.SimpleMailTest.main(SimpleMailTest.java:52)
Any idea what I might be doing wrong?
Hello rschreijer,
How do I send from an existing template using lutung?
I am trying to send my template
messages().sendTemplate("WelcomeTest", null, message, Boolean.TRUE);
I do receive mail as expected but on return "Failed to parse response from request". So I cant 100% be sure if the mail passed or not. Can it be fixed? (I also tried to figured/fix why its happened but unfortunately I cant debug your tests they always get skiped when I run them)
Thanks for help
First of thanks for the wonderful API. It covers many scenarios which mandrill provides.
Now, coming on the issue: I am trying to send an email with attachment, and for that I am using "MandrillMessage.MessageContent" class. The code I have used is:
List<MandrillMessage.MessageContent> attachments = new ArrayList<MandrillMessage.MessageContent>();
MandrillMessage.MessageContent messageContent = new MandrillMessage.MessageContent();
messageContent.setContent("test");
messageContent.setType("text/plain");
messageContent.setName("name.txt");
attachments.add(messageContent);
message.setAttachments(attachments); // Here message is "MandrillMessage"
so, this is the simplest case, and when I send mail using this attachment, the mail sent successfully and at the other end I received a mail with attachment but the data in attachment is all corrupted and not the one which I have set.
Can you please help me resolving this.
Thanks in advance,
Jaydatt
@rschreijer MergeVar Content attribute should be of type Object so in this way i could insert different objects in order to create generic templates and add more complexity to them.
I think this is an issue because if i use gson to convert, lets say, a map and set it to a merge var, the api will parse that string again encoding the map and leaving it useless:
ex:
at my code: "{"key":"value"}"
second time in the api side: "{"key":"value"}"
+1
Would you consider submitting this to the central Maven repository? It'd be terribly convenient to just do this when trying to use it:
<dependency>
<groupId>com.mandrillapp.wrapper.lutung</groupId>
<artifactId>lutung</artifactId>
<version>0.0.3-SNAPSHOT</version>
</dependency>
Or is it somewhere that I'm just not seeing, possibly under a different name?
I can't see how to add attachments to messages through this interface, am I missing something?
The MandrillApi
class' send message accepts a async
flag. However, even if I pass in true
for it, the execution thread waits for the mails to be dispatched. Setting the flag to false
behaves the same as well.
Is there some other settings required to be made for dispatching the mails in an asynchronous manner?
The execute()
method of MandrillRequestDispatcher
has a bug: If the request to Mandrill fails for some reason, the response
object gets null. This in turn leads to a NPE in the finally block. When the method is finally left with the NPE, the original exception cause is gone - making debugging very hard.
This codesmell is also detected by SonarLint, by the way.
PR is incoming.
See also: https://next.sonarqube.com/sonarqube/coding_rules#rule_key=csharpsquid%3AS1163
For some reason there is no address change feature. This is important for test and security purposes.
I'm using
mandrillApi.messages().send(message, true);
This is generating an Exception on android: android.os.NetworkOnMainThreadException in android 5.0.0 API 21.
.send(message, false) produces the same Exception.
Hello,
I am developing an application an I need to include some email addresses to the CC section of the message.
Looking around at the Mandrill API Docs, I only found support for TO and BCC. Is there any workaround to this? If not, are you open to pull requests for such a feature?
Thanks,
codelirium
there are a couple of open PRs with no reaction from @rschreijer or @billoneil so the question is whether Lutung is still maintained or if we better use something else...
I am writing some unit tests of my integration code and am attempting to mock MandrillMessageApi and the sendTemplate method. There are very few mock frameworks which are capable of working with final methods and classes.
Would you consider removing the final nature of the API classes so these APIs could be mocked in unit tests?
So far, I failed to successfully use Mandrills /messages/send-raw.json call. I'm not sure if I fail to create valid MIME contents, but lemme know if you make any experience with this call.
Can you re-enable headers mapping inside the MandrillMessageContent clazz?
Since a couple of weeks we are experiencing an issue with the library. After a couple a days of activity, sending email become impossible because of a HTTP 400 error.
This is the stack trace I have.
`java.lang.Exception: Email has not been sent. Miss use of the sender service : com.microtripit.mandrillapp.lutung.model.MandrillApiError: Unexpected http status in response: 400 (Bad request). Unparsable JSON response =
Restarting the server (jetty) solve the issue.
It's not an issue with the mandrill API because we have over application components sending email through Mandrill API without issue.
The metadata returned by the mandrill api on /messages/search.json does not get mapped to a member of MandrillMessageInfo
public final MandrillMessageInfo info(
final String messageId)
throws MandrillApiError, IOException {
final HashMap<String,Object> params = MandrillUtil.paramsWithKey(key);
if(messageId != null) {
params.put("id", messageId);
}
return MandrillUtil.query(rootUrl+ "messages/info.json",
params, MandrillMessageInfo.class);
}
Using the send() method, I get an exception when sending any message:
java.lang.NoSuchMethodError: No static method consume(Lorg/apache/http/HttpEntity;)V in class Lorg/apache/http/util/EntityUtils; or its super classes (declaration of 'org.apache.http.util.EntityUtils' appears in /system/framework/ext.jar) at com.microtripit.mandrillapp.lutung.model.MandrillRequestDispatcher.execute(MandrillRequestDispatcher.java:104)
The requestdispatcher tries to read a json formatted error from a response with error status code. But the response does not contain a json formatted error. Please throw in this case an exception with the original body content.
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:176)
at com.google.gson.Gson.fromJson(Gson.java:803)
at com.google.gson.Gson.fromJson(Gson.java:768)
at com.google.gson.Gson.fromJson(Gson.java:717)
at com.google.gson.Gson.fromJson(Gson.java:689)
at com.microtripit.mandrillapp.lutung.model.MandrillRequestDispatcher.execute(MandrillRequestDispatcher.java:62)
at com.microtripit.mandrillapp.lutung.controller.MandrillUtil.query(MandrillUtil.java:45)
at com.microtripit.mandrillapp.lutung.controller.MandrillMessagesApi.search(MandrillMessagesApi.java:239)
at ....mycode....
at ....mycode....
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1
at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:374)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:165)
... 11 more
I've noticed that when asking Mandrill to parse a raw email the headers
attribute in the response cannot always be deserialised. Values for a given header can be a string or an array.
Headers with multiple values cannot be deserialised into a MandrillMessage
since header values are only expected to be strings.
A response from the Mandrill parse request:
{
...
"headers": {
"Return-Path": "<[email protected]>",
"Received": [
"from mail123.google.com (mail.google.com [123.123.123]) by inbound-smtp.eu-west-1.amazonaws.com with SMTP id 23456 for [email protected]; Fri, 15 Jun 2018 09:30:43 +0000 (UTC)",
"by mail123.google.com with SMTP id 1234 for <[email protected]>; Fri, 15 Jun 2018 02:30:43 -0700 (PDT)"
],
...
}
The library then throws the following:
Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_ARRAY at line 1 column 70 path $.headers.
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:224)
at com.google.gson.Gson.fromJson(Gson.java:888)
at com.google.gson.Gson.fromJson(Gson.java:853)
at com.google.gson.Gson.fromJson(Gson.java:802)
at com.google.gson.Gson.fromJson(Gson.java:774)
at com.microtripit.mandrillapp.lutung.model.MandrillRequest.handleResponse(MandrillRequest.java:64)
... 8 more
Caused by: java.lang.IllegalStateException: Expected a string but was BEGIN_ARRAY at line 1 column 70 path $.headers.
at com.google.gson.stream.JsonReader.nextString(JsonReader.java:825)
at com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:401)
at com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:389)
I am potentially able to raise a PR that fixes this but will want a release with the fix fairly quickly. Will see how I get on.
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:176)
at com.google.gson.Gson.fromJson(Gson.java:803)
at com.google.gson.Gson.fromJson(Gson.java:768)
at com.google.gson.Gson.fromJson(Gson.java:717)
at com.google.gson.Gson.fromJson(Gson.java:689)
at com.microtripit.mandrillapp.lutung.model.MandrillRequestDispatcher.execute(MandrillRequestDispatcher.java:62)
at com.microtripit.mandrillapp.lutung.controller.MandrillUtil.query(MandrillUtil.java:45)
at com.microtripit.mandrillapp.lutung.controller.MandrillMessagesApi.sendTemplate(MandrillMessagesApi.java:211)
at com.microtripit.mandrillapp.lutung.controller.MandrillMessagesApi.sendTemplate(MandrillMessagesApi.java:138)
It is painful that this library brings in commons-logging and log4j, especially when it's only used for debugging.
It would be much cleaner to make the dependencies <optional>true</optional>
, and add a simple wrapper around logging that only calls commons-logging if it exists.
Also imho, slf4j would be make more sense than commons-logging, but as long as the dependency is optional, doesn't really matter I suppose.
I think this is more a Mandrill issue than a library one (since I had a similar issue with a PHP library), however, it would be good to get some insight into what I could potentially be doing wrong.
Sending with a template works as expected, and the handlebar variables are replaced correctly. When asking for a rendered template, however, the API returns the correct template, but with no variables replaced.
Here's my implementation (ignore the verboseness of some components, this is still very much in development!)
public String sendEmail(MemberDO member) throws MandrillApiError, IOException
{
final MergeVar[] mergeValues = { new MergeVar("member_first_name", member.getFirstName()),
new MergeVar("member_grade", member.getType().toString()), new MergeVar("member_number", member.getMembershipNumber()),
new MergeVar("initial_password", "still in development"),
new MergeVar("sponsor_info", member.getType().equals(MemberType.SPONSOR)) };
final Map<String, String> templateContent = new HashMap<String, String>();
for (MergeVar value : mergeValues)
{
templateContent.put(value.getName(), value.getContent().toString());
}
final String emailTo = member.getEmail();
final MergeVarBucket mergeBucket = new MergeVarBucket();
mergeBucket.setRcpt(emailTo);
mergeBucket.setVars(mergeValues);
final List<MergeVarBucket> mergeBuckets = new ArrayList<MergeVarBucket>();
mergeBuckets.add(mergeBucket);
final Recipient recipient = new Recipient();
recipient.setEmail(emailTo);
final List<Recipient> recipients = new ArrayList<Recipient>();
recipients.add(recipient);
final MandrillMessage message = new MandrillMessage();
message.setTo(recipients);
message.setMergeLanguage("handlebars");
message.setMergeVars(mergeBuckets);
final String render = mandrill.templates().render("welcome", templateContent, templateContent);
final MandrillMessageStatus[] deliveries = mandrill.messages().sendTemplate("welcome", templateContent, message, false);
return null; // render or delivery status
}
I attempted to run the HelloWorld example from the readme and received an "Unsupported cookie spec" error at the line ...
MandrillMessageStatus[] messageStatusReports = mandrillApi
.messages().send(message, false);
//Initiate Mandrill
MandrillApi mandrillApi = new MandrillApi("<My API Key>");
//Build Message
MandrillMessage message = new MandrillMessage();
message.setSubject("Hello World!!");
message.setHtml("<h1>Hi pal!</h1><br />Really, I'm just saying hi!");
message.setFromEmail("[email protected]");
message.setFromName("Stephan Rayner Personal Email");
//Build Recipients
ArrayList<Recipient> recipients = new ArrayList<Recipient>();
Recipient recipient = new Recipient();
recipient.setEmail("[email protected]");
recipient.setName("Stephan Rayner Work Email");
recipients.add(recipient);
/*This is where you add more*/
// Attach Recipients to message
message.setTo(recipients);
message.setPreserveRecipients(true);
// Create And Attach Tags
ArrayList <String> tags = new ArrayList<String>();
tags.add("test");
message.setTags(tags);
/* There are more message details that can be added*/
try {
MandrillMessageStatus[] messageStatusReports = mandrillApi
.messages().send(message, false);
// Iterate over responses
for (MandrillMessageStatus statusReport: messageStatusReports) {
_logger.info("Message Status Report: " + statusReport.getStatus());
}
} catch (MandrillApiError e){
_logger.error(e.getMandrillErrorAsJson(), e);
} catch (IOException e) {
_logger.error(e.getMessage());
}
java.lang.IllegalStateException: Unsupported cookie spec: default
at org.apache.http.cookie.CookieSpecRegistry.getCookieSpec(CookieSpecRegistry.java:110)
at org.apache.http.cookie.CookieSpecRegistry$1.create(CookieSpecRegistry.java:163)
at org.apache.http.client.protocol.RequestAddCookies.process(RequestAddCookies.java:157)
at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:132)
at org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:166)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:485)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:878)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:84)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:109)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
at com.microtripit.mandrillapp.lutung.model.MandrillRequestDispatcher.execute(MandrillRequestDispatcher.java:73)
at com.microtripit.mandrillapp.lutung.controller.MandrillUtil.query(MandrillUtil.java:46)
at com.microtripit.mandrillapp.lutung.controller.MandrillMessagesApi.send(MandrillMessagesApi.java:94)
at com.microtripit.mandrillapp.lutung.controller.MandrillMessagesApi.send(MandrillMessagesApi.java:49)
at <the file and line number where I called the aforementioned line>
Related to this link
TLS 1.0 and 1.1 Deprecation
On May 31, 2018, we’ll be retiring support for TLS versions 1.0 and 1.1 on all MailChimp sites, including MailChimp’s API. This change improves the security of the data sent between you and MailChimp, whether you’re accessing MailChimp through a browser, communicating directly with our API, or using one of our integrations.
The technologies that help secure data are under continuous scrutiny by security researchers. Over time, many of these technologies fall below an acceptable level of security and data privacy. For instance, recent attacks against older SSL versions (POODLE) as well as vulnerabilities with TLS (LOGJAM) have shown that transport security is rapidly changing. MailChimp’s security team constantly monitors for issues like this; we previously removed support for SSL 3.0 and older ciphers as insecurities in those technologies became known.
Now, the PCI Security Standards Council-an organization that defines security practices for businesses that handle cardholder data—has updated their requirements to remove support for early TLS versions. This means that we must begin the process of retiring these technologies at MailChimp, too; a change that may cause issues if the systems and software that power API clients do not support TLS version 1.2.
We strongly encourage any developers who are using the MailChimp API to ensure that their software supports negotiating TLS 1.2 connections, and to coordinate with their system administrators to update software to take advantage of newer TLS versions. In addition, we recommend proactively switching over to TLS 1.2 when communicating with MailChimp’s API by modifying your API client software to enforce TLS 1.2 negotiation.
This won't effect users running Java 8 or newer (and some non-public release versions of 7 (I think > 1.7.0_80?) as they default to TLSv1.2.
Hi,
I'm having some problems while trying to get info from subaccounts. The error is:
Unexpected http status in response: 500 (Internal Server Error)
Seems to happen when the subaccount does not exists
MandrillSubaccountInfo mandrillSubaccountInfo = mandrillApi.subaccounts().info(subaccountId);
subaccountId is 658
Also, when I try to send an email, and the subaccount doesn't exists, the error message shows:
{
"status": "error",
"name": "Unknown_Subaccount",
"message": "No subaccount exists with the id \u0027658\u0027",
"code": 12
}
How to use a template prepared at Mandrill's website?
In our network, we need to ignore certificate differences. Is this possible with lutung?
See:
http://unix.stackexchange.com/questions/60750/does-curl-have-a-no-check-certificate-option-like-wget
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.