From f08c2cb69e1f524132ff547eabc17978a476cc6f Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 26 Jun 2014 12:57:52 +0530 Subject: [PATCH] Changed System Signature to Footer --- .../outgoing_email_settings.json | 150 +++++++++--------- .../outgoing_email_settings.py | 4 +- frappe/hooks.py | 2 +- frappe/patches.txt | 2 +- .../patches/v4_1/set_outgoing_email_footer.py | 11 ++ .../set_outgoing_email_system_signature.py | 13 -- 6 files changed, 90 insertions(+), 92 deletions(-) create mode 100644 frappe/patches/v4_1/set_outgoing_email_footer.py delete mode 100644 frappe/patches/v4_1/set_outgoing_email_system_signature.py diff --git a/frappe/core/doctype/outgoing_email_settings/outgoing_email_settings.json b/frappe/core/doctype/outgoing_email_settings/outgoing_email_settings.json index 72c3963507..34fbd02313 100644 --- a/frappe/core/doctype/outgoing_email_settings/outgoing_email_settings.json +++ b/frappe/core/doctype/outgoing_email_settings/outgoing_email_settings.json @@ -1,105 +1,105 @@ { - "allow_copy": 1, - "creation": "2014-03-03 19:48:01", - "description": "Email Settings for Outgoing and Incoming Emails.", - "docstatus": 0, - "doctype": "DocType", + "allow_copy": 1, + "creation": "2014-03-03 19:48:01", + "description": "Email Settings for Outgoing and Incoming Emails.", + "docstatus": 0, + "doctype": "DocType", "fields": [ { - "description": "SMTP Server (e.g. smtp.gmail.com)", - "fieldname": "mail_server", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Outgoing Mail Server", + "description": "SMTP Server (e.g. smtp.gmail.com)", + "fieldname": "mail_server", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Outgoing Mail Server", "permlevel": 0 - }, + }, { - "description": "[?]", - "fieldname": "use_ssl", - "fieldtype": "Check", - "in_list_view": 1, - "label": "Use TLS", + "description": "[?]", + "fieldname": "use_ssl", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Use TLS", "permlevel": 0 - }, + }, { - "description": "If non standard port (e.g. 587)", - "fieldname": "mail_port", - "fieldtype": "Int", - "in_list_view": 1, - "label": "Port", + "description": "If non standard port (e.g. 587)", + "fieldname": "mail_port", + "fieldtype": "Int", + "in_list_view": 1, + "label": "Port", "permlevel": 0 - }, + }, { - "fieldname": "cb0", - "fieldtype": "Column Break", + "fieldname": "cb0", + "fieldtype": "Column Break", "permlevel": 0 - }, + }, { - "description": "Set Login and Password if authentication is required.", - "fieldname": "mail_login", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Login Id", + "description": "Set Login and Password if authentication is required.", + "fieldname": "mail_login", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Login Id", "permlevel": 0 - }, + }, { - "description": "Check this if you want to send emails as this id only (in case of restriction by your email provider).", - "fieldname": "always_use_login_id_as_sender", - "fieldtype": "Check", - "label": "Always use above Login Id as sender", + "description": "Check this if you want to send emails as this id only (in case of restriction by your email provider).", + "fieldname": "always_use_login_id_as_sender", + "fieldtype": "Check", + "label": "Always use above Login Id as sender", "permlevel": 0 - }, + }, { - "fieldname": "mail_password", - "fieldtype": "Password", - "label": "Mail Password", + "fieldname": "mail_password", + "fieldtype": "Password", + "label": "Mail Password", "permlevel": 0 - }, + }, { - "description": "System generated mails will be sent from this email id.", - "fieldname": "auto_email_id", - "fieldtype": "Data", - "label": "Auto Email Id", + "description": "System generated mails will be sent from this email id.", + "fieldname": "auto_email_id", + "fieldtype": "Data", + "label": "Auto Email Id", "permlevel": 0 - }, + }, { - "default": "1", - "description": "If checked, an email with an attached HTML format will be added to part of the EMail body as well as attachment. To only send as attachment, uncheck this.", - "fieldname": "send_print_in_body_and_attachment", - "fieldtype": "Check", - "label": "Send Print in Body and Attachment", + "default": "1", + "description": "If checked, an email with an attached HTML format will be added to part of the EMail body as well as attachment. To only send as attachment, uncheck this.", + "fieldname": "send_print_in_body_and_attachment", + "fieldtype": "Check", + "label": "Send Print in Body and Attachment", "permlevel": 0 - }, + }, { - "fieldname": "section_break_10", - "fieldtype": "Section Break", + "fieldname": "section_break_10", + "fieldtype": "Section Break", "permlevel": 0 - }, + }, { - "default": "
Sent via \n\tFrappe
", - "fieldname": "system_signature", - "fieldtype": "Text Editor", - "label": "System Signature", - "permlevel": 0, + "default": "
Sent via \n\tFrappe
", + "fieldname": "footer", + "fieldtype": "Text Editor", + "label": "Email Footer", + "permlevel": 0, "reqd": 0 } - ], - "icon": "icon-cog", - "idx": 1, - "in_create": 1, - "issingle": 1, - "modified": "2014-06-26 02:15:27.070400", - "modified_by": "Administrator", - "module": "Core", - "name": "Outgoing Email Settings", - "owner": "Administrator", + ], + "icon": "icon-cog", + "idx": 1, + "in_create": 1, + "issingle": 1, + "modified": "2014-06-26 02:15:27.070400", + "modified_by": "Administrator", + "module": "Core", + "name": "Outgoing Email Settings", + "owner": "Administrator", "permissions": [ { - "create": 1, - "permlevel": 0, - "read": 1, - "role": "System Manager", + "create": 1, + "permlevel": 0, + "read": 1, + "role": "System Manager", "write": 1 } ] -} \ No newline at end of file +} diff --git a/frappe/core/doctype/outgoing_email_settings/outgoing_email_settings.py b/frappe/core/doctype/outgoing_email_settings/outgoing_email_settings.py index 95ea9cc9b8..65838ee466 100644 --- a/frappe/core/doctype/outgoing_email_settings/outgoing_email_settings.py +++ b/frappe/core/doctype/outgoing_email_settings/outgoing_email_settings.py @@ -24,5 +24,5 @@ class OutgoingEmailSettings(Document): # exceptions are handled in session connect sess = smtpserver.sess -def get_system_signature(): - return frappe.db.get_value("Outgoing Email Settings", "Outgoing Email Settings", "system_signature") or "" +def get_mail_footer(): + return frappe.db.get_value("Outgoing Email Settings", "Outgoing Email Settings", "footer") or "" diff --git a/frappe/hooks.py b/frappe/hooks.py index 1dc714b49a..fd1377c7c0 100644 --- a/frappe/hooks.py +++ b/frappe/hooks.py @@ -75,4 +75,4 @@ scheduler_events = { ] } -mail_footer = "frappe.core.doctype.outgoing_email_settings.outgoing_email_settings.get_system_signature" +mail_footer = "frappe.core.doctype.outgoing_email_settings.outgoing_email_settings.get_mail_footer" diff --git a/frappe/patches.txt b/frappe/patches.txt index 2dd9599eaa..5c54e972e3 100644 --- a/frappe/patches.txt +++ b/frappe/patches.txt @@ -44,4 +44,4 @@ frappe.patches.v4_0.remove_user_owner_custom_field execute:frappe.delete_doc("DocType", "Website Template") execute:frappe.reload_doc('website', 'doctype', 'website_route') #2014-06-17 execute:frappe.db.sql("""update `tabProperty Setter` set property_type='Text' where property in ('options', 'default')""") #2014-06-20 -frappe.patches.v4_1.set_outgoing_email_system_signature +frappe.patches.v4_1.set_outgoing_email_footer diff --git a/frappe/patches/v4_1/set_outgoing_email_footer.py b/frappe/patches/v4_1/set_outgoing_email_footer.py new file mode 100644 index 0000000000..6d9bcbc1a5 --- /dev/null +++ b/frappe/patches/v4_1/set_outgoing_email_footer.py @@ -0,0 +1,11 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors +# MIT License. See license.txt + +from __future__ import unicode_literals +import frappe +from erpnext.setup.install import default_mail_footer + +def execute(): + mail_footer = frappe.db.get_default('mail_footer') or '' + mail_footer += default_mail_footer + frappe.db.set_value("Outgoing Email Settings", "Outgoing Email Settings", "footer", mail_footer) diff --git a/frappe/patches/v4_1/set_outgoing_email_system_signature.py b/frappe/patches/v4_1/set_outgoing_email_system_signature.py deleted file mode 100644 index 3f568857a8..0000000000 --- a/frappe/patches/v4_1/set_outgoing_email_system_signature.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors -# MIT License. See license.txt - -from __future__ import unicode_literals -import frappe -from erpnext.setup.install import default_system_signature - -def execute(): - system_signature = frappe.db.get_default('mail_footer') or '' - if not system_signature: - system_signature = default_system_signature - - frappe.db.set_value("Outgoing Email Settings", "Outgoing Email Settings", "system_signature", system_signature)