From e68c46d729a62047af1e9a707bdeba8ded8981fc Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Sun, 7 Apr 2019 16:56:38 +0200 Subject: [PATCH] Set email subjects statically App name is constant. --- Passepartout-iOS/Global/IssueReporter.swift | 2 +- .../Organizer/OrganizerViewController.swift | 2 +- Passepartout/Sources/AppConstants.swift | 16 ++++++---------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Passepartout-iOS/Global/IssueReporter.swift b/Passepartout-iOS/Global/IssueReporter.swift index e32795b7..6e422fd5 100644 --- a/Passepartout-iOS/Global/IssueReporter.swift +++ b/Passepartout-iOS/Global/IssueReporter.swift @@ -84,7 +84,7 @@ class IssueReporter: NSObject { let vc = MFMailComposeViewController() vc.setToRecipients([AppConstants.IssueReporter.Email.recipient]) - vc.setSubject(AppConstants.IssueReporter.Email.subject(GroupConstants.App.name)) + vc.setSubject(AppConstants.IssueReporter.Email.subject) vc.setMessageBody(AppConstants.IssueReporter.Email.body(description ?? AppConstants.IssueReporter.Email.template, metadata), isHTML: false) if let raw = debugLog { let attachment = DebugLog(raw: raw).decoratedData() diff --git a/Passepartout-iOS/Scenes/Organizer/OrganizerViewController.swift b/Passepartout-iOS/Scenes/Organizer/OrganizerViewController.swift index 17f46c2e..27da909b 100644 --- a/Passepartout-iOS/Scenes/Organizer/OrganizerViewController.swift +++ b/Passepartout-iOS/Scenes/Organizer/OrganizerViewController.swift @@ -210,7 +210,7 @@ class OrganizerViewController: UITableViewController, TableModelHost { let vc = MFMailComposeViewController() vc.setToRecipients([AppConstants.Translations.Email.recipient]) - vc.setSubject(AppConstants.Translations.Email.subject(GroupConstants.App.name)) + vc.setSubject(AppConstants.Translations.Email.subject) vc.setMessageBody(AppConstants.Translations.Email.body(AppConstants.Translations.Email.template), isHTML: false) vc.mailComposeDelegate = self vc.apply(Theme.current) diff --git a/Passepartout/Sources/AppConstants.swift b/Passepartout/Sources/AppConstants.swift index 430a61ba..bb2b952e 100644 --- a/Passepartout/Sources/AppConstants.swift +++ b/Passepartout/Sources/AppConstants.swift @@ -112,15 +112,13 @@ public class AppConstants { public class Email { public static let recipient = "issues@\(Domain.name)" - public static func subject(_ appName: String) -> String { - return "\(appName) - Report issue"; - } + public static let subject = "\(GroupConstants.App.name) - Report issue" public static func body(_ description: String, _ metadata: String) -> String { - return "Hi,\n\n\(description)\n\n\(metadata)\n\nRegards"; + return "Hi,\n\n\(description)\n\n\(metadata)\n\nRegards" } - public static let template = "description of the issue: "; + public static let template = "description of the issue: " } public class Filenames { @@ -147,15 +145,13 @@ public class AppConstants { public class Email { public static let recipient = "translate@\(Domain.name)" - public static func subject(_ appName: String) -> String { - return "\(appName) - Translations"; - } + public static let subject = "\(GroupConstants.App.name) - Translations" public static func body(_ description: String) -> String { - return "Hi,\n\n\(description)\n\nRegards"; + return "Hi,\n\n\(description)\n\nRegards" } - public static let template = "I offer to translate to: "; + public static let template = "I offer to translate to: " } }