summaryrefslogtreecommitdiffstats
path: root/welco/sources/mail/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'welco/sources/mail/utils.py')
-rw-r--r--welco/sources/mail/utils.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/welco/sources/mail/utils.py b/welco/sources/mail/utils.py
index 6c59add..babb71a 100644
--- a/welco/sources/mail/utils.py
+++ b/welco/sources/mail/utils.py
@@ -16,18 +16,19 @@
from django.conf import settings
-from .maarch import MaarchCourrier
+from .maarch import MaarchCourrier, MaarchError
class WelcoMaarchCourrier(MaarchCourrier):
def __init__(self, url, username, password, grc_status,
grc_received_status, grc_send_status, grc_refused_status,
- batch_size=10):
+ grc_response_status, batch_size=10):
super(WelcoMaarchCourrier, self).__init__(url, username, password)
self.grc_status = grc_status
self.grc_received_status = grc_received_status
self.grc_send_status = grc_send_status
self.grc_refused_status = grc_refused_status
+ self.grc_response_status = grc_response_status
self.batch_size = batch_size
def get_mails(self):
@@ -53,6 +54,10 @@ class WelcoMaarchCourrier(MaarchCourrier):
mail = self.Courrier(self, pk=mail_pk)
self.update_status([mail], self.grc_refused_status)
+ def set_grc_response_status(self, mail_pk, history_message):
+ mail = self.Courrier(self, pk=mail_pk)
+ self.update_status([mail], self.grc_response_status, history_message)
+
def get_maarch():
config = getattr(settings, 'MAARCH_FEED', {})
@@ -68,5 +73,6 @@ def get_maarch():
grc_status=config.get('STATUS_GRC', 'GRC'),
grc_received_status=config.get('STATUS_RECEIVED', 'GRC_TRT'),
grc_send_status=config.get('STATUS_SEND', 'GRCSENT'),
- grc_refused_status=config.get('STATUS_REFUSED', 'GRCREFUSED'))
+ grc_refused_status=config.get('STATUS_REFUSED', 'GRCREFUSED'),
+ grc_response_status=config.get('STATUS_REFUSED', 'GRC_RESPONSE'))