fix: newsletter template content
This commit is contained in:
parent
0ab1f5f7f8
commit
5fb2f74bb6
3 changed files with 16 additions and 5 deletions
|
|
@ -469,7 +469,7 @@ def get_request_header(key, default=None):
|
|||
def sendmail(recipients=[], sender="", subject="No Subject", message="No Message",
|
||||
as_markdown=False, delayed=True, reference_doctype=None, reference_name=None,
|
||||
unsubscribe_method=None, unsubscribe_params=None, unsubscribe_message=None, add_unsubscribe_link=1,
|
||||
attachments=None, content=None, doctype=None, name=None, reply_to=None,
|
||||
attachments=None, content=None, doctype=None, name=None, reply_to=None, queue_separately=False,
|
||||
cc=[], bcc=[], message_id=None, in_reply_to=None, send_after=None, expose_recipients=None,
|
||||
send_priority=1, communication=None, retry=1, now=None, read_receipt=None, is_notification=False,
|
||||
inline_images=None, template=None, args=None, header=None, print_letterhead=False, with_container=False):
|
||||
|
|
@ -519,7 +519,7 @@ def sendmail(recipients=[], sender="", subject="No Subject", message="No Message
|
|||
reference_doctype = doctype or reference_doctype, reference_name = name or reference_name, add_unsubscribe_link=add_unsubscribe_link,
|
||||
unsubscribe_method=unsubscribe_method, unsubscribe_params=unsubscribe_params, unsubscribe_message=unsubscribe_message,
|
||||
attachments=attachments, reply_to=reply_to, cc=cc, bcc=bcc, message_id=message_id, in_reply_to=in_reply_to,
|
||||
send_after=send_after, expose_recipients=expose_recipients, send_priority=send_priority,
|
||||
send_after=send_after, expose_recipients=expose_recipients, send_priority=send_priority, queue_separately=queue_separately,
|
||||
communication=communication, now=now, read_receipt=read_receipt, is_notification=is_notification,
|
||||
inline_images=inline_images, header=header, print_letterhead=print_letterhead, with_container=with_container)
|
||||
|
||||
|
|
|
|||
|
|
@ -68,13 +68,17 @@ class Newsletter(WebsiteGenerator):
|
|||
except IOError:
|
||||
frappe.throw(_("Unable to find attachment {0}").format(file.name))
|
||||
|
||||
args = {
|
||||
"message": self.get_message(),
|
||||
"name": self.name
|
||||
}
|
||||
frappe.sendmail(recipients=self.recipients, sender=sender,
|
||||
subject=self.subject, message=self.get_message(), template="newsletter",
|
||||
reference_doctype=self.doctype, reference_name=self.name,
|
||||
add_unsubscribe_link=self.send_unsubscribe_link, attachments=attachments,
|
||||
unsubscribe_method="/unsubscribe",
|
||||
unsubscribe_params={"name": self.name},
|
||||
send_priority=0, queue_separately=True)
|
||||
send_priority=0, queue_separately=True, args=args)
|
||||
|
||||
if not frappe.flags.in_test:
|
||||
frappe.db.auto_commit_on_many_writes = False
|
||||
|
|
|
|||
|
|
@ -1,3 +1,10 @@
|
|||
<div style="width: 600px;">
|
||||
{{message}}
|
||||
<div style="text-align: justify; padding-left: 150px;">
|
||||
<div style="width: 600px;">
|
||||
{{message}}
|
||||
</div>
|
||||
</div>
|
||||
<div style="font-size: 12px; line-height: 20px;">
|
||||
<div>
|
||||
Open in <a style="color: #687178; text-decoration: underline;" href="/newsletters/{{ name }}" target="_blank">web</a>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Add table
Reference in a new issue