mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-04 08:08:16 +02:00
Added option to use template name as subject
This commit is contained in:
@@ -676,7 +676,8 @@ public class EntityRule {
|
||||
|
||||
long iid = jargs.getLong("identity");
|
||||
long aid = jargs.getLong("answer");
|
||||
boolean add_text = jargs.optBoolean("text", true);
|
||||
boolean answer_subject = jargs.optBoolean("answer_subject", false);
|
||||
boolean original_text = jargs.optBoolean("original_text", true);
|
||||
String to = jargs.optString("to");
|
||||
boolean cc = jargs.optBoolean("cc");
|
||||
boolean attachments = jargs.optBoolean("attachments");
|
||||
@@ -699,6 +700,7 @@ public class EntityRule {
|
||||
throw new IllegalArgumentException("Rule template missing name=" + rule.name);
|
||||
|
||||
answer = new EntityAnswer();
|
||||
answer.name = message.subject;
|
||||
answer.text = "";
|
||||
} else {
|
||||
answer = db.answer().getAnswer(aid);
|
||||
@@ -749,7 +751,10 @@ public class EntityRule {
|
||||
reply.cc = message.cc;
|
||||
reply.unsubscribe = "mailto:" + identity.email;
|
||||
reply.auto_submitted = true;
|
||||
reply.subject = EntityMessage.getSubject(context, message.language, message.subject, !isReply);
|
||||
reply.subject = EntityMessage.getSubject(context,
|
||||
message.language,
|
||||
answer_subject ? answer.name : message.subject,
|
||||
!isReply);
|
||||
reply.received = new Date().getTime();
|
||||
reply.sender = MessageHelper.getSortKey(reply.from);
|
||||
|
||||
@@ -760,7 +765,7 @@ public class EntityRule {
|
||||
|
||||
String body = answer.getHtml(message.from);
|
||||
|
||||
if (add_text) {
|
||||
if (original_text) {
|
||||
Document msg = JsoupEx.parse(body);
|
||||
|
||||
Element div = msg.createElement("div");
|
||||
|
||||
@@ -140,7 +140,8 @@ public class FragmentRule extends FragmentBase {
|
||||
private Spinner spIdent;
|
||||
|
||||
private Spinner spAnswer;
|
||||
private CheckBox cbIncludeMessageText;
|
||||
private CheckBox cbAnswerSubject;
|
||||
private CheckBox cbOriginalText;
|
||||
private EditText etTo;
|
||||
private ImageButton ibTo;
|
||||
private CheckBox cbCc;
|
||||
@@ -291,7 +292,8 @@ public class FragmentRule extends FragmentBase {
|
||||
spIdent = view.findViewById(R.id.spIdent);
|
||||
|
||||
spAnswer = view.findViewById(R.id.spAnswer);
|
||||
cbIncludeMessageText = view.findViewById(R.id.cbIncludeMessageText);
|
||||
cbAnswerSubject = view.findViewById(R.id.cbAnswerSubject);
|
||||
cbOriginalText = view.findViewById(R.id.cbOriginalText);
|
||||
etTo = view.findViewById(R.id.etTo);
|
||||
ibTo = view.findViewById(R.id.ibTo);
|
||||
cbCc = view.findViewById(R.id.cbCc);
|
||||
@@ -1139,7 +1141,8 @@ public class FragmentRule extends FragmentBase {
|
||||
break;
|
||||
}
|
||||
|
||||
cbIncludeMessageText.setChecked(jaction.optBoolean("text", true));
|
||||
cbAnswerSubject.setChecked(jaction.optBoolean("answer_subject", false));
|
||||
cbOriginalText.setChecked(jaction.optBoolean("original_text", true));
|
||||
|
||||
etTo.setText(jaction.optString("to"));
|
||||
cbCc.setChecked(jaction.optBoolean("cc"));
|
||||
@@ -1481,7 +1484,8 @@ public class FragmentRule extends FragmentBase {
|
||||
EntityAnswer answer = (EntityAnswer) spAnswer.getSelectedItem();
|
||||
jaction.put("identity", identity == null ? -1 : identity.id);
|
||||
jaction.put("answer", answer == null || answer.id == null ? -1 : answer.id);
|
||||
jaction.put("text", cbIncludeMessageText.isChecked());
|
||||
jaction.put("answer_subject", cbAnswerSubject.isChecked());
|
||||
jaction.put("original_text", cbOriginalText.isChecked());
|
||||
jaction.put("to", etTo.getText().toString().trim());
|
||||
jaction.put("cc", cbCc.isChecked());
|
||||
jaction.put("attachments", cbWithAttachments.isChecked());
|
||||
|
||||
Reference in New Issue
Block a user