Laurynas Mykolaitis
10/18/2023, 10:39 AMLaurynas Mykolaitis
10/18/2023, 10:40 AMfun sendTest(context: Context) {
val htmlString: String = context.assets.open("email_invitation.html").bufferedReader().use { it.readText() }
val intent = Intent(Intent.ACTION_SEND).apply {
type = "text/html" // only email apps should handle this
putExtra(Intent.EXTRA_SUBJECT, context.getString(R.string.app_name))
putExtra(Intent.EXTRA_TEXT, Html.fromHtml(htmlString))
}
context.startActivity(Intent.createChooser(intent, context.getString(R.string.app_name)))
}
ascii
10/18/2023, 10:52 AMEXTRA_TEXT
. Nothing you can do, I think.
Also, your intent should be Intent(Intent.ACTION_SENDTO, "mailto:".toUri())
to restrict only to email apps.Laurynas Mykolaitis
10/18/2023, 12:03 PMascii
10/18/2023, 12:31 PMI am not going to discord or thirdparty places for thatThird party relative to what? Only one of the alternatives is a Discord server. Other two are Slack.