Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
8ea27d3
Initial commit of the modifications from the original project with ad…
knaak Apr 18, 2012
4d578f9
this file supports the serialization of the request to create a
knaak Apr 18, 2012
137c064
Update README.markdown
knaak Apr 18, 2012
d697bf4
fixed duplicate service, fixed template error.
knaak Apr 18, 2012
176bc5c
fixed javac bug by casting result of generic
knaak Apr 18, 2012
07f8ee3
added template del and update.
knaak Apr 19, 2012
4190e2d
gitignore for property files containing username/password stuff.
knaak Apr 19, 2012
03fb32d
gitignore updates
knaak Apr 19, 2012
3163a47
added co-copyright to some files
knaak Apr 19, 2012
4bc0b23
added template info, not fully tested as I have no options and seconds.
knaak Apr 19, 2012
afb718b
added undelete
knaak Apr 19, 2012
9bc049d
list template added
knaak Apr 19, 2012
b3069c2
partial implementation of listTemplates.
knaak Apr 19, 2012
c6e1832
added create campaign
knaak Apr 19, 2012
522e78d
fixed campaign, added javadoc help.
knaak Apr 19, 2012
c386cbe
delete campaigns added.
knaak Apr 19, 2012
1e6f32c
renamed created campaign to make it obvious its from a test case.
knaak Apr 19, 2012
5bb42e5
added gpl stuff to header of files.
knaak Apr 19, 2012
5b7c15f
fixed campaign create bug with subject and title not used properly.
knaak Apr 25, 2012
1ed29de
staring to add campaign list.
knaak Apr 25, 2012
3d6e4d6
more work improving campaignlist
knaak Apr 26, 2012
0e17189
added constants for campaigns, added javadoc help reference for
knaak Apr 26, 2012
550baf4
modified group ids to distinguish this from the original
knaak Apr 26, 2012
63f5d0e
added eclipse junk to gitignore
knaak Apr 26, 2012
8cf7a94
add support for Google Analytics.
knaak Apr 26, 2012
d05d6d1
started adding bounces
knaak Apr 27, 2012
6e0ccac
added test case, fixed bug.
knaak Apr 27, 2012
225ff66
bounces are now moved to CampaignMembers since bounce is depreciated.
knaak Apr 30, 2012
e1f3fb7
added FNAME and LNAME as optional parameters to batch subscribe.
knaak May 1, 2012
8fee7b3
added new method (untested as of yet) to be able to batch subscribe with
knaak May 11, 2012
a2f506f
added interface/service support for listbatchsubscribe with vars.
knaak May 11, 2012
f440217
tested listBatchSubscribeWithVars
knaak May 11, 2012
ac4a446
organize imports.
knaak May 11, 2012
7512d17
clean up commit to add docs, copyright etc.
knaak May 14, 2012
dfe1c8d
MailChimp changed the API to have a new field required called visibil…
knaak Sep 10, 2012
776b162
added new property parent_id
knaak Dec 10, 2012
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,13 @@ target/
**/*.iml
**/.idea
bin/

mailjimp-core/src/test/resources/mailjimp-test.properties

mailjimp-core/src/test/resources/mailjimp.properties

.project

.settings/org.eclipse.core.resources.prefs

.settings/org.eclipse.m2e.core.prefs
4 changes: 4 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

#### About

This fork is adapted from the original. My goal is to add in some missing service calls surrounding templates and campaigns.

#### Original About.

MailJimp is a MailChimp library built in Java intended for use within Maven-enabled Spring-based applications. MailJimp was tested against version 1.3 of the MailChimp API though most of the methods will work with version 1.2. (But I really don't know why you would use it ;)
The Maven part is not mandatory, of course - feel free to download the source and build yourself the library. The Spring part is also not mandatory, as long as you deploy the library in a container that understands the `@PostConstruct` annotation, or you manually invoke `MailJimpService::init()` after construction.

Expand Down
3 changes: 2 additions & 1 deletion mailjimp-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<name>MailChimp Java API - Core Components</name>

<parent>
<groupId>net.mailjimp</groupId>
<groupId>ca.morningstar.mailjimp</groupId>
<artifactId>mailjimp-parent</artifactId>
<version>0.4-SNAPSHOT</version>
</parent>
Expand Down Expand Up @@ -60,4 +60,5 @@
<version>2.1</version>
</dependency>
</dependencies>
<groupId>ca.morningstar.mailjimp</groupId>
</project>
19 changes: 19 additions & 0 deletions mailjimp-core/src/main/java/mailjimp/dom/MailJimpConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,23 @@ public interface MailJimpConstants extends Serializable {
String MERGE_EMAIL_TYPE = "EMAIL_TYPE";
String MERGE_GROUPINGS = "GROUPINGS";
String MERGE_GROUPS = "groups";

// Campaign Consts

final String CAMPAIGNTYPE_REGULAR = "regular";
final String CAMPAIGNTYPE_PLAINTEXT = "plaintext";
final String CAMPAIGNTYPE_ABSPLIT = "absplit";
final String CAMPAIGNTYPE_RSS = "rss";
final String CAMPAIGNTYPE_AUTO = "auto";

final String CAMPAIGNSTATUS_SENT = "sent";
final String CAMPAIGNSTATUS_SAVE = "save";
final String CAMPAIGNSTATUS_PAUSED = "paused";
final String CAMPAIGNSTATUS_SCHEDULE = "schedule";
final String CAMPAIGNSTATUS_SENDING = "sending";

final String CAMPAIGNMEMBER_STATUS_SENT = "sent";
final String CAMPAIGNMEMBER_STATUS_HARDBOUNCE = "hard";
final String CAMPAIGNMEMBER_STATUS_SOFTBOUNCE = "soft";
final String CAMPAIGNMEMBER_STATUS_ALL = "";
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.io.Serializable;

public abstract class MailJimpRequest implements Serializable {
protected String apikey;
protected String apikey;

protected MailJimpRequest(String apikey) {
this.apikey = apikey;
Expand Down
54 changes: 54 additions & 0 deletions mailjimp-core/src/main/java/mailjimp/dom/request/NamedBoolean.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright 2011 Tim Gilbert
*
* This file is part of MailJimp and forked MailJimp under https://github.com/knaak/MailJimp
*
* MailJimp is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* MailJimp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with MailJimp. If not, see <http://www.gnu.org/licenses/>.
*/

package mailjimp.dom.request;

import org.codehaus.jackson.annotate.JsonProperty;

public class NamedBoolean {

@JsonProperty
private String name;

@JsonProperty
private Boolean value;

public NamedBoolean(String name, Boolean value)
{
this.name = name;
this.value = value;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public Boolean getValue() {
return value;
}

public void setValue(Boolean value) {
this.value = value;
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
/*
* Copyright 2011 Michael Laccetti and Tim Gilbert
*
* This file is part of MailJimp and forked MailJimp under https://github.com/knaak/MailJimp
*
* MailJimp is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* MailJimp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with MailJimp. If not, see <http://www.gnu.org/licenses/>.
*/
package mailjimp.dom.request.campaign;

import java.util.HashMap;

import mailjimp.dom.request.MailJimpRequest;

import org.codehaus.jackson.annotate.JsonProperty;

public class CampaignCreateRequest extends MailJimpRequest {

@JsonProperty
private String type;

@JsonProperty
HashMap<String,Object> options;

@JsonProperty
HashMap<String,String> content;


public CampaignCreateRequest(String apikey, String type, HashMap<String,Object> options,HashMap<String,String> content) {
super(apikey);

this.type = type;
this.options = options;
this.content = content;
}

static public HashMap<String,Object> buildOptions(String listId, String campaignName, String subject, String fromEmail, String fromName, String toName, String googleUA)
{
HashMap<String,Object> options = new HashMap<String,Object>();

options.put("list_id", listId);
options.put("title", campaignName);
options.put("subject", subject);
options.put("from_email",fromEmail);
options.put("from_name",fromName);
options.put("to_name",toName);

if (googleUA != null)
{
HashMap<String,String> googleua = new HashMap<String,String>(1);
googleua.put("google", googleUA);
options.put("analytics", googleua);
}

return options;
}

static public HashMap<String,String> buildContentFromString(String html, String text)
{
HashMap<String,String> content = new HashMap<String,String>();
content.put("html", html);
content.put("text", text);
return content;

}

static public HashMap<String,String> buildContentFromUrl(String url)
{
HashMap<String,String> content = new HashMap<String,String>();
content.put("url", url);
return content;
}

static public HashMap<String,String> buildContentFromArchive(String archiveBase64, String archiveType)
{
HashMap<String,String> content = new HashMap<String,String>();
content.put("archive", archiveBase64);
content.put("archive_type", archiveType);
return content;
}




public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}

public HashMap<String, Object> getOptions() {
return options;
}

public void setOptions(HashMap<String, Object> options) {
this.options = options;
}

public HashMap<String, String> getContent() {
return content;
}

public void setContent(HashMap<String, String> content) {
this.content = content;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright 2011 Michael Laccetti and Tim Gilbert
*
* This file is part of MailJimp and forked MailJimp under https://github.com/knaak/MailJimp
*
* MailJimp is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* MailJimp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with MailJimp. If not, see <http://www.gnu.org/licenses/>.
*/
package mailjimp.dom.request.campaign;

import mailjimp.dom.request.MailJimpRequest;

import org.codehaus.jackson.annotate.JsonProperty;

public class CampaignDeleteRequest extends MailJimpRequest {


@JsonProperty("cid")
private String campaignId;

public CampaignDeleteRequest(String apikey, String campaignId) {
super(apikey);
this.campaignId = campaignId;

}

public String getCampaignId() {
return campaignId;
}

public void setCampaignId(String campaignId) {
this.campaignId = campaignId;
}

}
Loading