Skip to content

Commit

Permalink
MOB-1955 - Added support & feedback for all mail clients (#563)
Browse files Browse the repository at this point in the history
* MOB-1955 - Added support & feedback for all mail clients

* Localize feedback subject string
  • Loading branch information
Oleg-Pecheneg authored May 24, 2024
1 parent c2e94ad commit 2bf7923
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,8 @@ extension String {
static let settingsAppearanceThemeDark = "SETTINGS_APPEARANCE_THEME_DARK"
static let settingsAppearanceChooseTheme = "SETTINGS_APPEARANCE_CHOOSE_THEME"
static let youAreUnstoppable = "YOU_ARE_UNSTOPPABLE"

static let feedbackEmailSubject = "FEEDBACK_EMAIL_SUBJECT"

// Wallets list
static let manageICloudBackups = "MANAGE_ICLOUD_BACKUPS"
static let restoreFromICloudBackup = "RESTORE_FROM_ICLOUD_BACKUP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,12 +448,21 @@ private extension SettingsView {

@MainActor
func openFeedbackMailForm() {
let mail = MFMailComposeViewController()

mail.setToRecipients([Constants.UnstoppableSupportMail])
mail.setSubject("Unstoppable Domains App Feedback - iOS (\(UserDefaults.buildVersion))")

appContext.coreAppCoordinator.topVC?.present(mail, animated: true)
let canSendMail = MFMailComposeViewController.canSendMail()
let recipientMailAddress = Constants.UnstoppableSupportMail
let subject = String.Constants.feedbackEmailSubject.localized(UserDefaults.buildVersion)
if canSendMail {
let mail = MFMailComposeViewController()
mail.setToRecipients([recipientMailAddress])
mail.setSubject(subject)

appContext.coreAppCoordinator.topVC?.present(mail, animated: true)
} else {
let mailURLString = "mailto:\(recipientMailAddress)?subject=\(subject)"
guard let url = URL(string: mailURLString) else { return }

UIApplication.shared.open(url)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@
"SETTINGS_APPEARANCE_THEME_DARK" = "Dark";
"SETTINGS_APPEARANCE_CHOOSE_THEME" = "Choose theme";
"YOU_ARE_UNSTOPPABLE" = "You are Unstoppable!";
"FEEDBACK_EMAIL_SUBJECT" = "Unstoppable Domains App Feedback - iOS (%@)";

// Wallets list
"MANAGE_ICLOUD_BACKUPS" = "Manage iCloud backups";
Expand Down

0 comments on commit 2bf7923

Please sign in to comment.