Skip to content

Commit

Permalink
Fix missing signature in pop-up mail composer
Browse files Browse the repository at this point in the history
  • Loading branch information
iliajie committed Sep 6, 2023
1 parent 065b663 commit 3788273
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion extensions/mail/mail.min.js

Large diffs are not rendered by default.

Binary file modified extensions/mail/mail.min.js.gz
Binary file not shown.
17 changes: 13 additions & 4 deletions extensions/mail/mail.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,11 @@ const mail = (function() {
</div>
</form>
`;
},
html: {
tags: {
br: '<br>',
}
}
}

Expand Down Expand Up @@ -1052,10 +1057,14 @@ const mail = (function() {
return this.name
}).get(),
form_data = $form.serialize(),
$form_textare = $(rs).find('textarea[name="body"]'),
toolbar_mode = $form_textare.data('html-mode'),
signature = $.trim(_.plugin.quote_escape(_.plugin.html_strip($form_textare.text())));
$form_textarea = $(rs).find('textarea[name="body"]'),
toolbar_mode = $form_textarea.data('html-mode'),
signature = $.trim(_.plugin.quote_escape(_.plugin.html_strip($form_textarea.text())));

if (config.d.u.html_edit == 2 && signature) {
signature = `${$$.$.template.html.tags.br.repeat(2) + signature}`;
}

if (form_data) {
form_data = _.plugin.serialized_to_json(form_data);

Expand Down Expand Up @@ -2244,7 +2253,7 @@ const mail = (function() {
bcc: element.input('bcc', data.visible),
subject: element.input('subject', data.visible),
attachments: element.input(classes.form.name.tattach, data.visible, false, true),
body: data.visible.body,
body: types.new == 1 ? signature : data.visible.body,
signature: signature,
toolbar_mode: toolbar_mode
})
Expand Down
Binary file modified unauthenticated/js/bundle.min.js.gz
Binary file not shown.

0 comments on commit 3788273

Please sign in to comment.