Send photo to consumers

Can you help with a script to send a photo? I can’t seem to figure it out

Luckily the latest beta 1.0 (20) allows you to do this.

let msg = new Message()
msg.recipients = ["9108675309"] // <--- array of numbers
msg.body = "This is the body of my message"


I understand that part but how do you place the image in to the (Img). I’m still learning

That depends where you are getting the image from. The one script I am working on, I am retrieving the image from a url.

let map = ""
let req = new Request(map)
let marker = await req.loadImage()
1 Like

There’s a few different ways to get an image. Here’s a few examples.

Getting the latest image from your photo library
let img = await Photos.latestPhoto()

Picking a photo from the photo library
let img = await Photos.fromLibrary()

Taking a photo with the camera
let img = await Photos.fromCamera()

Picking a photo using the document picker

let uti = "public.image"
let filePaths = await[uti])
let img = Image.fromFile(filePaths[0])