Skip to content

Commit

Permalink
fix body generation
Browse files Browse the repository at this point in the history
  • Loading branch information
cekk committed May 10, 2024
1 parent 2f64278 commit 42b2108
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/rer/newsletter/browser/message/sendingtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from plone.z3cform.layout import wrap_form
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from rer.newsletter import _
from rer.newsletter.behaviors.ships import IShippable
from rer.newsletter.content.channel import Channel
from rer.newsletter.utils import compose_sender
from rer.newsletter.utils import get_site_title
Expand Down Expand Up @@ -47,7 +46,9 @@ def _getDate(self):
return datetime.today().strftime("Newsletter %d-%m-%Y")

def _getMessage(self, channel, message, footer):
message_template = self.context.restrictedTraverse("@@messagepreview_view")
message_template = self.context.restrictedTraverse(
"@@messagepreview_view"
)
parameters = {
"message_subheader": f"""
<tr>
Expand Down Expand Up @@ -109,11 +110,15 @@ def handleSave(self, action):
"enabled": ns_obj.standard_unsubscribe,
}
unsubscribe_footer_text = unsubscribe_footer_template(**parameters)
body = self._getMessage(ns_obj, message_obj, unsubscribe_footer_text)
body = self._getMessage(
ns_obj, message_obj, unsubscribe_footer_text
)

sender = compose_sender(channel=ns_obj)

nl_subject = " - " + ns_obj.subject_email if ns_obj.subject_email else ""
nl_subject = (
" - " + ns_obj.subject_email if ns_obj.subject_email else ""
)

subject = "Messaggio di prova - " + message_obj.title + nl_subject
# per mandare la mail non passo per l'utility
Expand Down

0 comments on commit 42b2108

Please sign in to comment.