hey, I want to make an app where you can send pictures via this app to an email.
I want to know how can I make a choice Component where I can select 1,2,3,4 and if I click 4 I get 4 slots where I can put pictures in it. but if it is possible then I will like to have a picture picker but where i can select multiple pictures,
after I have done that I want to send all of the pictures to an email how can I do that.
I will like to have if it is possible that it send the pictures in pdf not links
If you can make this of good quality I will pay you
Seems pretty straightforward. The only issue youâre gonna run into is that when the email get sent, the email wonât actually have picture attachments but rather links to those images. If youâre OK with that, we can help you proceed.
you can write a triggered script to create pdf from a sheet where you can have IMAGE() with links to these pictures and then attach it:
// get PDF
var PDFsheet_ID = âyour sheet Id hereâ; //pdf sheet ID
var requestData = {âmethodâ: âGETâ, âheadersâ:{âAuthorizationâ:"Bearer "+ScriptApp.getOAuthToken()}};
var URL = "https://docs.google.com/spreadsheets/d/"+PDFsheet_ID+"/export"+
"?format=pdf&"+
"size=a4&"+
"fzr=true&"+
"portrait=true&"+
"fitw=true&"+
"gridlines=false&"+
"pagenum=CENTER&"+
"attachment=true";
var response = UrlFetchApp.fetch(URL,requestData).getBlob();
MailApp.sendEmail({
to: email,
subject: subject,
body: body,
attachments:[{fileName:filename + ".pdf", content: response.getBytes(),mimeType: "application//pdf"} ],
htmlBody: body
});
I imagine youâre going to have a sheet that has columns for each of your four images as well as a number column to house your quantity. All of these columns are going to be user specific unless theyâre on a user profile sheet if youâre requiring your users to sign in. Create a screen which allows them to select the quantity via choice component and then based on the quantity, use visibility conditions like @Krivo said to display that many number of image components each writing to their own column.
To get the images into an email, you can craft the body of an email in a template Column making sure to include each of the four image columns as variables in the template column.
To send the email, create a button with a custom action. In this action, first include a compose email action that includes all of the columns and information that you need making sure that that template column is the email body field. Afterwords, use a set columns action to clear your user specific columns to prepare for the next time you want to add images.
hey thanks you for your post i am totally new to this so when you say.
Create a screen which allows them to select the quantity via choice component and then based on the quantity, use visibility conditions like @Krivo said to display that many number of image components each writing to their own column.
1st one: Always visible
2nd one: Visible when Choice greater or equal to 2
3rd one: Visible when Choice greater or equal to 3
4th one: Visible when Choice equals 4