click the link above and crate a script account and enter the console if you havent already
create a new script
use this code
function doPost(e) {
var body = e.parameters.message;
var subject = e.parameters.subject;
var who = e.parameters.who;
GmailApp.sendEmail(who, subject, body)
}
click publish → deploy as web app → deploy/update
now you can send this app information and it will send an email. based on the model above we would send an API POST request to the URL that appscript provides when you deploy the app.
step 3 - create the code to send the email
notice the object property names attached to the API QueryParameters match the parameters from the script code above.
you’ll create an OTP and send it based on some action in the app.
The message I get from the status block is ‘undefined’
The message from the error block is ‘load failed’
The message from the response block is just blank…
Thank you so much for the tutorial, however, the email does not want to send. the API always seems to fail in sending the email. Can you please check my code for any errors?