Email a Customer Receipt

Follow these steps to email a customer receipt from a previous transaction.
  1. Retrieve the
    SendEmailReceiptIntent
    value from the
    mposUi
    object and use the
    startActivity
    method to initiate the emailing a receipt flow.
    val SendEmailReceiptIntent = mposUi.createSendEmailReceiptIntent(transactionIdentifier) startActivityForResult(SendEmailReceiptIntent, MposUi.REQUEST_CODE_SEND_EMAIL)
  2. After the emailing activity is completed,
    onActivityResult
    is triggered, which returns information about the status of the emailing activity.
    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {     super.onActivityResult(requestCode, resultCode, data)     "onActivityResult: $resultCode".logDebug(TAG)     val parentLayout: View = activity!!.findViewById(android.R.id.content)       if (requestCode == MposUi.REQUEST_CODE_SEND_EMAIL) {         if (resultCode == MposUi.RESULT_CODE_EMAIL_SUCCESS) {             Snackbar.make(parentLayout, "Receipt sent via email", Snackbar.LENGTH_SHORT).show()         }         else if (resultCode == MposUi.RESULT_CODE_EMAIL_FAILED) {             Snackbar.make(parentLayout, "Fail while sending receipt via email", Snackbar.LENGTH_SHORT).show()         }     } }