Skip to content

Commit

Permalink
fix: Insert signature after mailto body
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinperignon committed Jun 21, 2023
1 parent 29e77c9 commit 8972ca4
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 8972ca4

Please sign in to comment.