Changed System Signature to Footer

This commit is contained in:
Anand Doshi 2014-06-26 12:57:52 +05:30
parent 17f80e860a
commit f08c2cb69e
6 changed files with 90 additions and 92 deletions

View file

@ -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": "<a href=\"https://en.wikipedia.org/wiki/Transport_Layer_Security\" target=\"_blank\">[?]</a>",
"fieldname": "use_ssl",
"fieldtype": "Check",
"in_list_view": 1,
"label": "Use TLS",
"description": "<a href=\"https://en.wikipedia.org/wiki/Transport_Layer_Security\" target=\"_blank\">[?]</a>",
"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": "<div style=\"padding: 7px; text-align: right; color: #888\"><small>Sent via \n\t<a style=\"color: #888\" href=\"http://frappe.io\">Frappe</a></div>",
"fieldname": "system_signature",
"fieldtype": "Text Editor",
"label": "System Signature",
"permlevel": 0,
"default": "<div style=\"padding: 7px; text-align: right; color: #888\"><small>Sent via \n\t<a style=\"color: #888\" href=\"http://frappe.io\">Frappe</a></div>",
"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
}
]
}
}

View file

@ -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 ""

View file

@ -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"

View file

@ -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

View file

@ -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)

View file

@ -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)