In my app I have the following function:
static func createMessageBodyForImportingJSON(greeting: String, body: String) -> String {
let htmlHdrTop = "<!DOCTYPE html><html><body>"
let htmlHdrBot = "</body></html>"
let openP = "<p>"
let closeP = "</p>"
let salutation = "<br>Thank you,"
let body = body
let haveAppInstructions = String(localized: "** IMPORTANT - THE EASY WAY ** Before you import this file make sure you have HymnTracker installed on your device. If you do not have the app installed, go to the AppStore and download the app. Once installed, you can then tap the file and choose HymnTracker to open it.<br><br>** THE LONG WAY ** If you want, you can take the long way around by following the instructions below for saving the file to the Files App and then selecting the file and importing it.", table: "EmailAndPDF+Strings", comment: "Instructions for getting the Hymn Tracker App")
let saveFileInstructions = String(localized: "Instructions for saving attached file.", table: "EmailAndPDF+Strings", comment: "List of instruction on how to save the backup copy of the library.") + "<br>" + "     " +
String(localized: "1. Long press on the attached file", table: "EmailAndPDF+Strings", comment: "Step 1 on saving the library.") + "<br>" + "     " +
String(localized: "2. Tap 'Save to Files'", table: "EmailAndPDF+Strings", comment: "Step 2 on saving the library.") + "<br>" + "     " +
String(localized: "3. Choose a folder in iCloud Drive", table: "EmailAndPDF+Strings", comment: "Step 3 on saving the library.") + "<br>" + "     " +
String(localized: "4. Tap 'Save' in the upper right corner", table: "EmailAndPDF+Strings", comment: "Step 4 on saving the library.") + "<br><br>"
let importFileInstructions = String(localized: "Instructions for importing attached file once it's saved in the Files app.", table: "EmailAndPDF+Strings", comment: "List of instructions on how to import a library.") + "<br>" + "     " +
String(localized: "1. Tap Programs Tab", table: "EmailAndPDF+Strings", comment: "Step 1 on importing the selected library.") + "<br>" + "     " +
String(localized: "2. Tap menu button in the upper right corner of the screen.", table: "EmailAndPDF+Strings", comment: "Step 2 on importing the selected library.") + "<br>" + "     " +
String(localized: "3. Tap 'Import Programs From Files' option in the drop down menu.", table: "EmailAndPDF+Strings", comment: "Step 3 on importing the selected library.") + "<br>" + "     " +
String(localized: "4. From the file importer screen find where you saved the file 'HymnTracker-Library.htData' and select it.", table: "EmailAndPDF+Strings", comment: "Step 3 on importing the selected library.") + "<br>" + "     " +
String(localized: "5. Importing will then begin and close the screen.", table: "EmailAndPDF+Strings", comment: "Step 4 on importing the selected library.")
let mainBody = openP + greeting + "<br><br>" + haveAppInstructions + "<br><br>" + body + "<br><br>" + saveFileInstructions + importFileInstructions + "<br><br>" + closeP
return htmlHdrTop + mainBody + openP + salutation + closeP + htmlHdrBot
}
This returns an email message body.
I would like to be able to add a hyperlink that would say "Download The App" when you tap that in the email it would take you to the app store. I have the URL, but if I create a NSMutuableAttributedString then it won't let me concatenate that with strings. So, I don't quite not how to get a hyperlink in the email body.
Any help would be appreciated.
Taz