java-mandrill-wrapper's Introduction
For example usage, see the integration tests in src/it/java. You'll need to create a file called mandrill.properties and put it somewhere on the classpath. It'll need the following properties. apiKey= email.from= email.to.name1= email.to.address1= email.to.name2= email.to.address2= verify.email=
java-mandrill-wrapper's People
Forkers
makeandbuild pbackx minichate trillint yfonseca seanpreston aphethean pawlorj sujithasv ddecours neosavvyinc jramsdale martinchooooooo robshep ahapxor alphaadidas llem makotovh sauce-archives aluedeke it-toroleo toroleo basisklasse spiderstrategies giran nenew12 djalexd ergin-a1 marcelocoliveira sbeigel ezyinsights aharontu cuongpham89 sergiomilici telrod pragatisinghireslab ingmontoro srinivassunkaraneni komasoftware amit4tech joshuavanaalst balamurugan678 srnm miciurash stanislasbonifetto mxlv xavi-reloaded quoctuan86 netforce1 avenauche mepraveen geliojr aswin89thee waar19 sujan7 m1slash vbareishajava-mandrill-wrapper's Issues
Licensing
Hey
Could you please drop a MIT license callout so that we could utilize this wrapper in our codebase
there is no support for send_at in MandrillTemplatedMessageRequest
see http://help.mandrill.com/entries/24331201-Can-I-schedule-a-message-to-send-at-a-specific-time-
https://mandrillapp.com/api/docs/messages.JSON.html#method=send
mandrill has an API for scheduling, canceling and rescheduling message.
Spring boot @Bean does not work
I am unable to create an @bean for the MandrillConfiguration object. My attempt at an implementation of this is as follows:
@Configuration
public class MandrillConfig {
@Value("${mailchimp.apikey}")
private String API_KEY;
@Bean
public MandrillConfiguration getMandrillConfiguration(){
MandrillConfiguration mandrillConfiguration = new MandrillConfiguration();
mandrillConfiguration.setApiKey("ptZ7-xBthKB64JK8T8uDbA");
mandrillConfiguration.setApiVersion("1.0");
mandrillConfiguration.setBaseURL("https://mandrillapp.com/api");
return mandrillConfiguration;
}
}
When using the following:
@Autowired
MandrillConfiguration mandrillconfiguration;
I always get null.
If I am doing something wrong please inform me.
If you are excepting pull request I will contribute if I can fix this issue.
Deserialize from JSON back to object model
As part of some integration tests, I serlialize the json to file, and then want to deseriliaze back to the object model.
I had to make some minor code changes, by creating no-arg constructors for MandrillRecipient, MergeVar and MandrillAttachment.
Would you be able to make those small changes to master - it would really help alot.
Thanks for the great work!
We get the following Exception when we use the API and get an error on the Mandrill side
UnrecognizedPropertyException in MandrillTransactionEmailCommitJob: Json Mapping Exception
com.projecta.framework.backend.util.UnexpectedException: UnrecognizedPropertyException: Json Mapping Exception
at com.projecta.bobby.commons.mail.transaction.mandrill.MandrillTransactionEmailQueue.sendEmail(MandrillTransactionEmailQueue.java:136)
at com.projecta.bobby.commons.mail.transaction.mandrill.MandrillTransactionEmailQueue.commit(MandrillTransactionEmailQueue.java:143)
at com.projecta.framework.backend.util.collection.CommittableQueue.commitQueue(CommittableQueue.java:67)
at com.projecta.bobby.commons.mail.transaction.mandrill.MandrillTransactionEmailCommitJob.doRun(MandrillTransactionEmailCommitJob.java:15)
at com.projecta.framework.backend.cronjob.core.CronJobRunner.execute(CronJobRunner.java:68)
at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: com.cribbstechnologies.clients.mandrill.exception.RequestFailedException: Json Mapping Exception
at com.cribbstechnologies.clients.mandrill.request.MandrillRESTRequest.performPostRequest(MandrillRESTRequest.java:84)
at com.cribbstechnologies.clients.mandrill.request.MandrillRESTRequest.postRequest(MandrillRESTRequest.java:37)
at com.cribbstechnologies.clients.mandrill.request.MandrillMessagesRequest.sendTemplatedMessage(MandrillMessagesRequest.java:37)
at com.projecta.bobby.commons.mail.transaction.mandrill.MandrillTransactionEmailQueue.sendEmail(MandrillTransactionEmailQueue.java:134)
at com.projecta.bobby.commons.mail.transaction.mandrill.MandrillTransactionEmailQueue.commit(MandrillTransactionEmailQueue.java:143)
at com.projecta.framework.backend.util.collection.CommittableQueue.commitQueue(CommittableQueue.java:67)
at com.projecta.bobby.commons.mail.transaction.mandrill.MandrillTransactionEmailCommitJob.doRun(MandrillTransactionEmailCommitJob.java:15)
at com.projecta.framework.backend.cronjob.core.CronJobRunner.execute(CronJobRunner.java:68)
at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "reject_reason" (Class com.cribbstechnologies.clients.mandrill.model.response.message.MessageResponse), not marked as ignorable
at [Source: java.io.StringReader@7acedf24; line: 1, column: 114](through reference chain: com.cribbstechnologies.clients.mandrill.model.response.message.MessageResponse["reject_reason"])
at org.codehaus.jackson.map.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:53)
at org.codehaus.jackson.map.deser.StdDeserializationContext.unknownFieldException(StdDeserializationContext.java:267)
at org.codehaus.jackson.map.deser.std.StdDeserializer.reportUnknownProperty(StdDeserializer.java:673)
at org.codehaus.jackson.map.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:659)
at org.codehaus.jackson.map.deser.BeanDeserializer.handleUnknownProperty(BeanDeserializer.java:1365)
at org.codehaus.jackson.map.deser.BeanDeserializer._handleUnknown(BeanDeserializer.java:725)
at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:703)
at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:580)
at org.codehaus.jackson.map.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:217)
at org.codehaus.jackson.map.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:194)
at org.codehaus.jackson.map.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:30)
at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2732)
at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1870)
at com.cribbstechnologies.clients.mandrill.request.MandrillRESTRequest.convertAnonymousListResponseData(MandrillRESTRequest.java:108)
at com.cribbstechnologies.clients.mandrill.request.MandrillRESTRequest.performPostRequest(MandrillRESTRequest.java:77)
at com.cribbstechnologies.clients.mandrill.request.MandrillRESTRequest.postRequest(MandrillRESTRequest.java:37)
at com.cribbstechnologies.clients.mandrill.request.MandrillMessagesRequest.sendTemplatedMessage(MandrillMessagesRequest.java:37)
at com.projecta.bobby.commons.mail.transaction.mandrill.MandrillTransactionEmailQueue.sendEmail(MandrillTransactionEmailQueue.java:134)
at com.projecta.bobby.commons.mail.transaction.mandrill.MandrillTransactionEmailQueue.commit(MandrillTransactionEmailQueue.java:143)
at com.projecta.framework.backend.util.collection.CommittableQueue.commitQueue(CommittableQueue.java:67)
at com.projecta.bobby.commons.mail.transaction.mandrill.MandrillTransactionEmailCommitJob.doRun(MandrillTransactionEmailCommitJob.java:15)
at com.projecta.framework.backend.cronjob.core.CronJobRunner.execute(CronJobRunner.java:68)
at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
I would add a field to MessageResponse but wanted to ask for your Opinion first.
Does it supported the collections in MergeVar content?
The send-template.json (https://mandrillapp.com/api/docs/messages.JSON.html#method=send-template) supports mixed content, but the type of MergeVar content field is a String.
Do you know how I can pass a collection or an array to the template, so I can iterate over in the template?
Or we can add a new MergeVar class that supports object in content?
thanks
carbon copy function
Is there any way to add carbon copy function in your wrapper?
Support for async option in /messages/send API
Hi, Mandrill API has an option called async in /messages/send API. Does this library support async option? Thanks!
Multi-Thread issue
Hi,
I'm having some problems when I try to send messages in a multi-thread scenario (with the same httpclient instance, using PoolingHttpClientConnectionManager).
After the message is sent in MandrillRESTRequest, the connections aren't closed; when the app reaches the max conn set in httpclient, the messages get blocked and aren't sent.
I fixed it making a copy of MandrillRESTRequest in my working directory and converting HttpClient to CloseableHttpClient (httpclient 4.3.1) and HttpResponse to CloseableHttpResponse, to be able to do this modification:
try {
entity = response.getEntity();
} finally {
response.close();
}
BufferedReader br = new BufferedReader(new InputStreamReader((entity.getContent())));
(this recommendation of closing the connection in a multi-thread environment is detailed here: http://hc.apache.org/httpcomponents-client-ga/tutorial/html/connmgmt.html#d5e392).
Maybe there's a way to do this connection close without modifying method signature.
MessageResponse breaks after Mandrill addedd new property
Last week Mandrill added a new property in the response to a postRequest.
A property called _id was added.
This makes the method convertAnonymousResponseData break when the objectMapper tries to do readValue.
An error is thrown and this is passed to the application as an IOError.
Suggestion:
Make MessageResponse ignore unknown properties by adding @JsonIgnoreProperties(ignoreUnknown = true)
This way the new _id, and any future additions of properties can be ignored without sending errors to the application
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.