Merge pull request #7407 from surajshetty3416/communication-email-template
feat: Add email template field to Communication
This commit is contained in:
commit
a6aec85674
3 changed files with 388 additions and 1669 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -22,7 +22,7 @@ from frappe.utils.background_jobs import enqueue
|
|||
def make(doctype=None, name=None, content=None, subject=None, sent_or_received = "Sent",
|
||||
sender=None, sender_full_name=None, recipients=None, communication_medium="Email", send_email=False,
|
||||
print_html=None, print_format=None, attachments='[]', send_me_a_copy=False, cc=None, bcc=None,
|
||||
flags=None, read_receipt=None, print_letterhead=True):
|
||||
flags=None, read_receipt=None, print_letterhead=True, email_template=None):
|
||||
"""Make a new communication.
|
||||
|
||||
:param doctype: Reference DocType.
|
||||
|
|
@ -38,6 +38,7 @@ def make(doctype=None, name=None, content=None, subject=None, sent_or_received =
|
|||
:param print_format: Print Format name of parent document to be sent as attachment.
|
||||
:param attachments: List of attachments as list of files or JSON string.
|
||||
:param send_me_a_copy: Send a copy to the sender (default **False**).
|
||||
:param email_template: Template which is used to compose mail .
|
||||
"""
|
||||
|
||||
is_error_report = (doctype=="User" and name==frappe.session.user and subject=="Error Report")
|
||||
|
|
@ -66,6 +67,7 @@ def make(doctype=None, name=None, content=None, subject=None, sent_or_received =
|
|||
"sent_or_received": sent_or_received,
|
||||
"reference_doctype": doctype,
|
||||
"reference_name": name,
|
||||
"email_template": email_template,
|
||||
"message_id":get_message_id().strip(" <>"),
|
||||
"read_receipt":read_receipt,
|
||||
"has_attachment": 1 if attachments else 0
|
||||
|
|
|
|||
|
|
@ -549,6 +549,7 @@ frappe.views.CommunicationComposer = Class.extend({
|
|||
print_format: print_format,
|
||||
sender: form_values.sender,
|
||||
sender_full_name: form_values.sender?frappe.user.full_name():undefined,
|
||||
email_template: form_values.email_template,
|
||||
attachments: selected_attachments,
|
||||
_lang : me.lang_code,
|
||||
read_receipt:form_values.send_read_receipt,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue