Переглянути джерело

fix: Remove salutation from email

Reasons:
- It shows up only when few conditons (which are not very clear) are met. Since the behaviour is not consistent it creates unnecessary confusion
- Salutations are not configurable. Not all users want to start their email with "Dear" in which case they have to clear it first.
version-14
Suraj Shetty 3 роки тому
джерело
коміт
a90a9ed807
2 змінених файлів з 1 додано та 12 видалено
  1. +1
    -2
      frappe/public/js/frappe/form/form.js
  2. +0
    -10
      frappe/public/js/frappe/views/communication.js

+ 1
- 2
frappe/public/js/frappe/form/form.js Переглянути файл

@@ -1146,8 +1146,7 @@ frappe.ui.form.Form = class FrappeForm {
subject: __(this.meta.name) + ': ' + this.docname, subject: __(this.meta.name) + ': ' + this.docname,
recipients: this.doc.email || this.doc.email_id || this.doc.contact_email, recipients: this.doc.email || this.doc.email_id || this.doc.contact_email,
attach_document_print: true, attach_document_print: true,
message: message,
real_name: this.doc.real_name || this.doc.contact_display || this.doc.contact_name
message: message
}); });
} }




+ 0
- 10
frappe/public/js/frappe/views/communication.js Переглянути файл

@@ -263,7 +263,6 @@ frappe.views.CommunicationComposer = class {
const subject_field = me.dialog.fields_dict.subject; const subject_field = me.dialog.fields_dict.subject;


let content = content_field.get_value() || ""; let content = content_field.get_value() || "";
content = content.split('<!-- salutation-ends -->')[1] || content;


content_field.set_value(`${reply.message}<br>${content}`); content_field.set_value(`${reply.message}<br>${content}`);
subject_field.set_value(reply.subject); subject_field.set_value(reply.subject);
@@ -725,15 +724,6 @@ frappe.views.CommunicationComposer = class {


message += await this.get_signature(); message += await this.get_signature();


const SALUTATION_END_COMMENT = "<!-- salutation-ends -->";
if (this.real_name && !message.includes(SALUTATION_END_COMMENT)) {
message = `
<p>${__('Dear {0},', [this.real_name], 'Salutation in new email')},</p>
${SALUTATION_END_COMMENT}<br>
${message}
`;
}

if (this.is_a_reply) { if (this.is_a_reply) {
message += this.get_earlier_reply(); message += this.get_earlier_reply();
} }


Завантаження…
Відмінити
Зберегти