File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
SwiftUI-WorkoutApp/Libraries/SWUtils/Sources/SWUtils Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -12,11 +12,16 @@ public enum FeedbackSender {
1212 messageBody: String ,
1313 recipients: [ String ]
1414 ) {
15+ guard !recipients. isEmpty else {
16+ assertionFailure ( " Не указан список получателей письма " )
17+ return
18+ }
1519 let encodedSubject = subject. addingPercentEncoding ( withAllowedCharacters: . urlPathAllowed) ?? " Feedback "
1620 let encodedBody = messageBody. addingPercentEncoding ( withAllowedCharacters: . urlPathAllowed) ?? " "
17- if let firstRecipient = recipients. first {
18- let url = URL ( string: " mailto: \( firstRecipient) ?subject= \( encodedSubject) &body= \( encodedBody) " )
19- URLOpener . open ( url)
20- }
21+ let encodedRecipients = recipients
22+ . map { $0. addingPercentEncoding ( withAllowedCharacters: . urlQueryAllowed) ?? $0 }
23+ . joined ( separator: " , " )
24+ let url = URL ( string: " mailto: \( encodedRecipients) ?subject= \( encodedSubject) &body= \( encodedBody) " )
25+ URLOpener . open ( url)
2126 }
2227}
You can’t perform that action at this time.
0 commit comments