Skip to content

Commit

Permalink
Merge pull request #823 from Infomaniak/fix-mailto-text-position
Browse files Browse the repository at this point in the history
fix: Insert signature after mailto body
  • Loading branch information
PhilippeWeidmann committed Jun 22, 2023
2 parents 7aec620 + 943b677 commit c09b6a1
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Mail/Views/New Message/ComposeMessageBodyView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,16 @@ struct ComposeMessageBodyView: View {
}

let html = "<br><br><div class=\"editorUserSignature\">\(signature.content)</div>"
switch signature.position {
case .beforeReplyMessage:
$draft.body.wrappedValue.insert(contentsOf: html, at: draft.body.startIndex)
case .afterReplyMessage:
$draft.body.wrappedValue.append(contentsOf: html)
var signaturePosition = draft.body.endIndex
if messageReply != nil {
switch signature.position {
case .beforeReplyMessage:
signaturePosition = draft.body.startIndex
case .afterReplyMessage:
signaturePosition = draft.body.endIndex
}
}
$draft.body.wrappedValue.insert(contentsOf: html, at: signaturePosition)
}
}

Expand Down

0 comments on commit c09b6a1

Please sign in to comment.