Compare commits
4 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b2113bcd88 | ||
![]() |
860355f8af | ||
![]() |
3591b7e317 | ||
![]() |
ec3fd0b2fb |
|
@ -5,6 +5,12 @@ All notable changes to rattail-mailchimp will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## v0.3.3 (2024-07-05)
|
||||||
|
|
||||||
|
### Fix
|
||||||
|
|
||||||
|
- define `host_key` for MailChimp -> Rattail import
|
||||||
|
|
||||||
## v0.3.2 (2024-07-01)
|
## v0.3.2 (2024-07-01)
|
||||||
|
|
||||||
### Fix
|
### Fix
|
||||||
|
|
11
README.md
Normal file
11
README.md
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
|
||||||
|
# rattail_mailchimp
|
||||||
|
|
||||||
|
Rattail is a retail software framework, released under the GNU General
|
||||||
|
Public License.
|
||||||
|
|
||||||
|
This package contains software interfaces for the
|
||||||
|
[MailChimp](https://mailchimp.com/) system.
|
||||||
|
|
||||||
|
Please see the [Rattail Project](https://rattailproject.org/) for more
|
||||||
|
information.
|
14
README.rst
14
README.rst
|
@ -1,14 +0,0 @@
|
||||||
|
|
||||||
rattail_mailchimp
|
|
||||||
=================
|
|
||||||
|
|
||||||
Rattail is a retail software framework, released under the GNU General
|
|
||||||
Public License.
|
|
||||||
|
|
||||||
This package contains software interfaces for the `MailChimp`_ system.
|
|
||||||
|
|
||||||
.. _`MailChimp`: https://mailchimp.com/
|
|
||||||
|
|
||||||
Please see the `Rattail Project`_ for more information.
|
|
||||||
|
|
||||||
.. _`Rattail Project`: https://rattailproject.org/
|
|
|
@ -6,9 +6,9 @@ build-backend = "hatchling.build"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "rattail-mailchimp"
|
name = "rattail-mailchimp"
|
||||||
version = "0.3.2"
|
version = "0.3.3"
|
||||||
description = "Rattail Software Interfaces for MailChimp"
|
description = "Rattail Software Interfaces for MailChimp"
|
||||||
readme = "README.rst"
|
readme = "README.md"
|
||||||
authors = [{name = "Lance Edgar", email = "lance@edbob.org"}]
|
authors = [{name = "Lance Edgar", email = "lance@edbob.org"}]
|
||||||
license = {text = "GNU GPL v3+"}
|
license = {text = "GNU GPL v3+"}
|
||||||
classifiers = [
|
classifiers = [
|
||||||
|
|
|
@ -24,10 +24,10 @@
|
||||||
Config extensions for rattail-mailchimp
|
Config extensions for rattail-mailchimp
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from rattail.config import ConfigExtension
|
from wuttjamaican.conf import WuttaConfigExtension
|
||||||
|
|
||||||
|
|
||||||
class MailchimpConfigExtension(ConfigExtension):
|
class MailchimpConfigExtension(WuttaConfigExtension):
|
||||||
"""
|
"""
|
||||||
Config extension for rattail-mailchimp
|
Config extension for rattail-mailchimp
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
#
|
||||||
# Rattail -- Retail Software Framework
|
# Rattail -- Retail Software Framework
|
||||||
# Copyright © 2010-2023 Lance Edgar
|
# Copyright © 2010-2024 Lance Edgar
|
||||||
#
|
#
|
||||||
# This file is part of Rattail.
|
# This file is part of Rattail.
|
||||||
#
|
#
|
||||||
|
@ -30,7 +30,6 @@ from collections import OrderedDict
|
||||||
from mailchimp3 import MailChimp
|
from mailchimp3 import MailChimp
|
||||||
|
|
||||||
from rattail import importing
|
from rattail import importing
|
||||||
from rattail.time import localtime, make_utc
|
|
||||||
from rattail_mailchimp import importing as mailchimp_importing
|
from rattail_mailchimp import importing as mailchimp_importing
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,7 +37,9 @@ class FromMailChimpToRattail(importing.ToRattailHandler):
|
||||||
"""
|
"""
|
||||||
Handler for MailChimp -> Rattail cache import
|
Handler for MailChimp -> Rattail cache import
|
||||||
"""
|
"""
|
||||||
|
host_key = 'mailchimp'
|
||||||
host_title = "MailChimp"
|
host_title = "MailChimp"
|
||||||
|
generic_host_title = "MailChimp"
|
||||||
|
|
||||||
def get_importers(self):
|
def get_importers(self):
|
||||||
importers = OrderedDict()
|
importers = OrderedDict()
|
||||||
|
@ -53,7 +54,7 @@ class FromMailChimp(importing.Importer):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
super(FromMailChimp, self).setup()
|
super().setup()
|
||||||
|
|
||||||
self.api_key = self.config.require('mailchimp', 'api_key')
|
self.api_key = self.config.require('mailchimp', 'api_key')
|
||||||
self.mailchimp = MailChimp(self.api_key)
|
self.mailchimp = MailChimp(self.api_key)
|
||||||
|
@ -65,10 +66,10 @@ class FromMailChimp(importing.Importer):
|
||||||
# issue..since we clearly have a UTC value
|
# issue..since we clearly have a UTC value
|
||||||
value = value[:-6]
|
value = value[:-6]
|
||||||
dt = datetime.datetime.strptime(value, '%Y-%m-%dT%H:%M:%S')
|
dt = datetime.datetime.strptime(value, '%Y-%m-%dT%H:%M:%S')
|
||||||
dt = localtime(self.config, dt, from_utc=True)
|
dt = self.app.localtime(dt, from_utc=True)
|
||||||
else:
|
else:
|
||||||
dt = datetime.datetime.strptime(value, '%Y-%m-%dT%H:%M:%S%z')
|
dt = datetime.datetime.strptime(value, '%Y-%m-%dT%H:%M:%S%z')
|
||||||
dt = localtime(self.config, dt)
|
dt = self.app.localtime(dt)
|
||||||
return dt
|
return dt
|
||||||
|
|
||||||
|
|
||||||
|
@ -95,7 +96,7 @@ class MailChimpListImporter(FromMailChimp, mailchimp_importing.model.MailChimpLi
|
||||||
return {
|
return {
|
||||||
'id': mclist['id'],
|
'id': mclist['id'],
|
||||||
'name': mclist['name'],
|
'name': mclist['name'],
|
||||||
'date_created': make_utc(date_created),
|
'date_created': self.app.make_utc(date_created),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -160,6 +161,6 @@ class MailChimpListMemberImporter(FromMailChimp, mailchimp_importing.model.MailC
|
||||||
'status': member['status'],
|
'status': member['status'],
|
||||||
# TODO: this API endpoint does not appear to include this field?
|
# TODO: this API endpoint does not appear to include this field?
|
||||||
# 'unsubscribe_reason': member.get('unsubscribe_reason'),
|
# 'unsubscribe_reason': member.get('unsubscribe_reason'),
|
||||||
'last_changed': make_utc(last_changed),
|
'last_changed': self.app.make_utc(last_changed),
|
||||||
'source': member['source'],
|
'source': member['source'],
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue