-
Notifications
You must be signed in to change notification settings - Fork 1
pyopenemm
pratz edited this page Aug 31, 2012
·
12 revisions
OpenEMM - http://www.openemm.org/
OpenEMM is a feature-rich web-based enterprise application for email marketing, newsletters and service mails.
You can find the documentation to install openemm and its web services here
http://sourceforge.net/projects/openemm/files/OpenEMM%20documentation/Documentation%20%28latest%20versions%29/
So, there was no python api for openemm, pyopenemm tries to be one.
Required Software's :
- Python 2.6 or higher
- Suds ( python SOAP client )
Configuration :
Configure openemm wsdl url in pyopenemm/config.py like so
OPENEMM_URL = 'http://172.16.0.153:8080/cms_services/urn:agnitas-webservice?wsdl'
Basic Usage :
In [1]: from pyopenemm.connection.connect import create_connection
In [2]: from pyopenemm.webservice.service import OpenEMM
In [3]: username = 'prathamesh' # openemm webservice username
In [4]: password = 'test_123' # openemm webservice password
In [5]: client = create_connection() # connect to webservice , returned is suds client
In [6]: openemm = OpenEMM(client,username,password) # openemm class
In [7]: subscriber = openemm.find_subscriber(('email','[email protected]')) # get subcriber by email , args is tuple where 1st element is key column and 2nd is value
In [8]: subscriber # returns the id of subscriber
Out[8]: 3
In [7]: subscriber = openemm.get_subscriber(3)
In [8]: from pprint import pprint
In [9]: pprint(subscriber)
{change_date: 2004-06-16 22:47:10,
change_date_day_date: 16,
change_date_hour_date: 22,
change_date_minute_date: 47,
change_date_month_date: 6,
change_date_second_date: 10,
change_date_year_date: 2004,
creation_date: 2004-06-16 22:40:01,
creation_date_day_date: 16,
creation_date_hour_date: 22,
creation_date_minute_date: 40,
creation_date_month_date: 6,
creation_date_second_date: 1,
creation_date_year_date: 2004,
customer_id: 3,
datasource_id: 0,
email: [email protected],
firstname: pratz,
gender: 0,
lastname: NEV,
mailtype: None,
title: None}
NOTE : openemm object will show you all the methods (just to confirm)
**More to follow .. ........ .. . **