edx-ace 1.8.0__py2.py3-none-any.whl → 1.9.1__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
edx_ace/__init__.py CHANGED
@@ -13,7 +13,7 @@ from .policy import Policy, PolicyResult
13
13
  from .recipient import Recipient
14
14
  from .recipient_resolver import RecipientResolver
15
15
 
16
- __version__ = '1.8.0'
16
+ __version__ = '1.9.1'
17
17
 
18
18
 
19
19
  __all__ = [
@@ -62,6 +62,7 @@ class DjangoEmailChannel(EmailChannelMixin, Channel):
62
62
  from_email=from_address,
63
63
  to=[message.recipient.email_address],
64
64
  reply_to=reply_to,
65
+ headers=message.headers,
65
66
  )
66
67
 
67
68
  mail.attach_alternative(rendered_template, 'text/html')
edx_ace/message.py CHANGED
@@ -73,6 +73,9 @@ class Message(MessageAttributeSerializationMixin, metaclass=ABCMeta):
73
73
  default=None
74
74
  )
75
75
  options = attr.ib()
76
+
77
+ # headers are only supported for DjangoEmailChannel
78
+ headers = attr.ib()
76
79
  language = attr.ib(default=None)
77
80
  log_level = attr.ib(default=None)
78
81
 
@@ -84,6 +87,10 @@ class Message(MessageAttributeSerializationMixin, metaclass=ABCMeta):
84
87
  def default_options_value(self):
85
88
  return {}
86
89
 
90
+ @headers.default
91
+ def default_headers_value(self):
92
+ return {}
93
+
87
94
  @uuid.default
88
95
  def generate_uuid(self):
89
96
  return uuid4()
edx_ace/monitoring.py CHANGED
@@ -2,16 +2,8 @@
2
2
  :mod:`edx_ace.monitoring` exposes functions that are useful for reporting ACE
3
3
  message delivery stats to monitoring services.
4
4
  """
5
- try:
6
- import newrelic.agent
7
- except ImportError:
8
- newrelic = None # pylint: disable=invalid-name
5
+ from edx_django_utils.monitoring import set_custom_attribute
9
6
 
10
7
 
11
8
  def report(key, value):
12
- report_to_newrelic(key, value)
13
-
14
-
15
- def report_to_newrelic(key, value):
16
- if newrelic:
17
- newrelic.agent.add_custom_parameter(key, value)
9
+ set_custom_attribute(key, value)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: edx-ace
3
- Version: 1.8.0
3
+ Version: 1.9.1
4
4
  Summary: Framework for Messaging
5
5
  Home-page: https://github.com/openedx/edx-ace
6
6
  Author: edX
@@ -20,6 +20,7 @@ Classifier: Programming Language :: Python :: 3.12
20
20
  Description-Content-Type: text/x-rst
21
21
  Requires-Dist: Django >=2.2
22
22
  Requires-Dist: attrs >=17.2.0
23
+ Requires-Dist: edx-django-utils >=5.14.2
23
24
  Requires-Dist: python-dateutil
24
25
  Requires-Dist: sailthru-client ==2.2.3
25
26
  Requires-Dist: six
@@ -1,10 +1,10 @@
1
- edx_ace/__init__.py,sha256=QK9U8KJ2IfPBtPIHTPA9bXIqj4ofz2IBUrpkMN5u1jo,635
1
+ edx_ace/__init__.py,sha256=ae6idgNCwwTYrHhRuO2dU-f3BfESx57-v9ZWNJD_XsE,635
2
2
  edx_ace/ace.py,sha256=TkNk8GPe_l7u9aXD8woj3qIc9QdVEwphSPYZHGVuOBE,1788
3
3
  edx_ace/apps.py,sha256=xNedkdW6TNpm-W1uxnj3Vre2R1akkh2n_7DkSfKXmAk,216
4
4
  edx_ace/delivery.py,sha256=Tjc3GKubPaDsbKiBXO2jQBz9ursJ3nb7ZgZNSEeuqWQ,2690
5
5
  edx_ace/errors.py,sha256=y0MqT55qXLkpn_r5LVhHcYuU2-zHs56CQTAbNCqb72k,1065
6
- edx_ace/message.py,sha256=dSuAd3W3FUWXN67aJTwd970tBsk1bU-af1Vn9z2VyP4,8182
7
- edx_ace/monitoring.py,sha256=ZrPYe1eetsV2bTEqUCthEWvWV-u5Cto2oEykawilyLc,408
6
+ edx_ace/message.py,sha256=lhmPor9vnaLvC4NPyRgB-obpGjGv9Lni0obcOUTgyCg,8340
7
+ edx_ace/monitoring.py,sha256=6nEcAJMCr9keCTJw9JjGecTg_J1ubcGJfuGiFq2B8G4,257
8
8
  edx_ace/policy.py,sha256=Zi0oupnmvgnW7jOkEpgsOd-gj6isR-3Mna2SxsdG4U8,2915
9
9
  edx_ace/presentation.py,sha256=Vjb3gz0M1dU9aToYvX7mAWPenmpKDsAdqqv0n2TWE-A,778
10
10
  edx_ace/recipient.py,sha256=ogZjjKorAc6yiqvcnXcAMsHz2uAfhYU5qLPUoifofXQ,576
@@ -13,7 +13,7 @@ edx_ace/renderers.py,sha256=oBHBqtqzp2UIrA0Xem_k2jHLEVDRhZMAwiqOTPll3qk,2764
13
13
  edx_ace/serialization.py,sha256=EptnQqbI9j5kVqdUDAlm2pcm3dUsFwsP9tAji3y5uqc,3775
14
14
  edx_ace/channel/__init__.py,sha256=gqF84UXnB-ZdtGxnMAI0h-kqf0SUP3P1qmspE-HhldQ,6713
15
15
  edx_ace/channel/braze.py,sha256=k-R9jZpiBQTV0FQ3Z2gOipVgxNpBMPSLBL71muh9go4,10240
16
- edx_ace/channel/django_email.py,sha256=05HIz62m1Qac8H7jBETEANFeG-jD2O1MNBIXSFJqFFU,2133
16
+ edx_ace/channel/django_email.py,sha256=9TNdiFJ2U3QjKEriUl3_9twAFkH-E2EmrWujStUOWN0,2174
17
17
  edx_ace/channel/file.py,sha256=_Jx8o5Cw8IpEdaF7g-ljF7CEqswBHmuwyupm_tkI2wk,3028
18
18
  edx_ace/channel/mixins.py,sha256=kmSBFcBU2OhMqlzaDZPrZpT3lh6ccte0cQeCCvo8FNc,1313
19
19
  edx_ace/channel/sailthru.py,sha256=IQlM7krP8I9045FXkW01_rzJ--5Z0rRlxYIKIk-_w3I,12699
@@ -36,9 +36,9 @@ edx_ace/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
36
  edx_ace/utils/date.py,sha256=Rmz3RAUCdd30hu1qcKH7FmAypaw1aSoZg-yfZig1c8A,1483
37
37
  edx_ace/utils/once.py,sha256=sY3szBh3gvvAjrKbKq4S2mCejompjh5YcYD7XOhzjGU,2024
38
38
  edx_ace/utils/plugins.py,sha256=U-l-eU2uWUiiwYV-H-2DfmwjoksqskAsYwS7QnThy2Q,2090
39
- edx_ace-1.8.0.dist-info/LICENSE.txt,sha256=VrSJ4gO4NCpskzfNHbaTB4VcN9Q213YdcHbpOZSwcOA,35138
40
- edx_ace-1.8.0.dist-info/METADATA,sha256=e0-f3x2FSwuBY19W9VueRhxMblrfTfNeB6xfOUffrjc,9888
41
- edx_ace-1.8.0.dist-info/WHEEL,sha256=-G_t0oGuE7UD0DrSpVZnq1hHMBV9DD2XkS5v7XpmTnk,110
42
- edx_ace-1.8.0.dist-info/entry_points.txt,sha256=_snuuwhVrcq5eAeES7JSMYrv1e973sHbmzJpTd10ld4,254
43
- edx_ace-1.8.0.dist-info/top_level.txt,sha256=5eg_80KI88VkeiCVqZUqcYcc_PfPOg8o1GA4HxsiRU8,8
44
- edx_ace-1.8.0.dist-info/RECORD,,
39
+ edx_ace-1.9.1.dist-info/LICENSE.txt,sha256=VrSJ4gO4NCpskzfNHbaTB4VcN9Q213YdcHbpOZSwcOA,35138
40
+ edx_ace-1.9.1.dist-info/METADATA,sha256=uMs0g7gpBR75Btbg4xDtzBHTDQHK5xVhGuZZ053YvI0,9929
41
+ edx_ace-1.9.1.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
42
+ edx_ace-1.9.1.dist-info/entry_points.txt,sha256=_snuuwhVrcq5eAeES7JSMYrv1e973sHbmzJpTd10ld4,254
43
+ edx_ace-1.9.1.dist-info/top_level.txt,sha256=5eg_80KI88VkeiCVqZUqcYcc_PfPOg8o1GA4HxsiRU8,8
44
+ edx_ace-1.9.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any