Send email from kodular with google script, without using extensions

Hello friends, maybe some of you already know, but I share this brief guide for sending email from kodular with a gmail account.
No extensions or anything is needed, just use the script provided by Google and kodular the WEB component.

We enter Google Drive with our account.
now click on + new > more > google apps script

In the script console we paste our script code

function myFunction() {
}

function doGet(){
return ContentService.createTextOutput(“online”);
}

function doPost(e){
var body = e.parameter.body;
MailApp.sendEmail({
to: e.parameter.to,
subject: e.parameter.subject,
body: body,
htmlBody: body
});
return ContentService.createTextOutput(“success”);
};

it would be like this

Once the code has been pasted, click Deploy > New deployment

When we finish it will give us a script url that we will use in kodular

In Kodular we add a WEB component and create the blocks as in the example

That’s all. Greetings :+1:

9 Likes

Thnks working

@Gaston definitely the email account need to use gmail right to send out?

Yes you need email that will deliver your side email, just follow the guide it’s really fast

returned “error”, did i missed something?
i test in companion, should be no issue right?

UPDATE
can work now as earlier when i tried to save this project into my Drive Google gave me error for the success and error quote

i tried don’t save and straight Deploy (which earlier also Google don’t let me), but now can :expressionless_face:

Give me few minute i will give working method

You solved it?

solved as use back your original code and deploy it
thanks! :crossed_fingers:

1 Like