Hello… Any help on this would be appreciated!
I’m attempting to programmatically add email attachments to a native.showpopup call, but can’t get this to work.
I’m sure this is due to some lack of knowledge about lua tables and strings, but I can’t figure this out.
(1) If I hardcode “attachment = { baseDir=system.DocumentsDirectory, filename=‘mtnphoto1.jpg’, type=‘image/jpg’ },” everything works fine. The generated email includes the attachment.
(2) However, I want to do this programmatically since there may be zero, one, or many photos. So, in the simplest case (that doesn’t work) I ignore multiple photos and simply create the following string with one photo attachment:
milestonePhotoList = “{ baseDir=system.DocumentsDirectory, filename=‘mtnphoto1.jpg’, type=‘image’ },”
and then the attachment (for native show.popup mail options) looks like this:
attachment = milestonePhotoList (this crashes the app)
or
attachment = _G.milestonePhotoList (the email is created, but no attachment)!
Any help or direction is much appreciated! Thank you! -Keith