├── .gitignore
├── .travis.yml
├── LICENSE.md
├── README.md
├── pom.xml
└── src
├── main
├── java
│ └── com
│ │ └── msiops
│ │ └── premailer
│ │ ├── Premailer.java
│ │ └── PremailerInterface.java
└── ruby
│ └── premailer
│ └── premailer_contact.rb
└── test
└── java
└── com
└── msiops
└── premailer
├── PremailerInlineHTMLTest.java
└── PremailerPlainTextTest.java
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by .ignore support plugin (hsz.mobi)
2 | ### Maven template
3 | target/
4 | pom.xml.tag
5 | pom.xml.releaseBackup
6 | pom.xml.versionsBackup
7 | pom.xml.next
8 | release.properties
9 | dependency-reduced-pom.xml
10 | buildNumber.properties
11 | .mvn/timing.properties
12 |
13 |
14 | ### Java template
15 | *.class
16 |
17 | # Mobile Tools for Java (J2ME)
18 | .mtj.tmp/
19 |
20 | # Package Files #
21 | *.jar
22 | *.war
23 | *.ear
24 |
25 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
26 | hs_err_pid*
27 |
28 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: java
2 | jdk:
3 | - oraclejdk8
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | Copyright 2015 Matthew de Detrich, mdedetrich@gmail.com
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Java Premailer Wrapper
2 |
3 | [](https://maven-badges.herokuapp.com/maven-central/org.mdedetrich/java-premailer-wrapper)
4 |
5 | ## What is this?
6 |
7 | This java wrapper around [Premailer](https://github.com/premailer/premailer). It is roughly based on the
8 | wrapper from [here](https://github.com/r-shah/java-premailer-wrapper), with a few important differences
9 |
10 | - It works
11 | - Premailer is brought in as a dependency rather than being directly included in the source. This allows you
12 | to easily bump Premailer as a dependency
13 | - Added a method that allows you to terminate a Premailer instance (`PremailerInterface.destroyInstance`)
14 | - A fix for JDK 1.8 in regards to conflicts for `.merge ` method (see [here](https://github.com/jruby/jruby/issues/1249))
15 | - The `Premailer` class no longer acts like a pseudo singleton. Its up to the user to manage the instance (typically you
16 | would store this in a Singleton to reuse the `PremailerInstance`)
17 | - Uses a versioning scheme to identify between Premailer releases, i.e. 1.0_1.8.7 means version 1 using Premailer 1.8.7
18 |
19 | ## Dependency Info
20 |
21 | Currently hosted on maven central, with the following details
22 |
23 | ```xml
24 |
25 | org.mdedetrich
26 | java-premailer-wrapper
27 | 1.3_1.8.7
28 |
29 | ```
30 |
31 | If you haven't already done so, you need to add the `Rubygems` maven repository, i.e.
32 |
33 | ```xml
34 |
35 | rubygems-releases
36 | http://rubygems-proxy.torquebox.org/releases
37 |
38 | ```
39 |
40 | ## Building
41 |
42 | You can build a jar by doing
43 |
44 | ```
45 | mvn compile
46 | mvn package
47 | ```
48 |
49 | ## Usage
50 |
51 | To use, do something like this
52 |
53 | ```java
54 | String testHtml = "