[ Free ] Make Custom email sender API with google apps script

Let’s make a custom email sender API by google apps script.
By this API you can send a custom email also you can send email templates.

Features and usages
  • Totally free
  • You can send any kind of email template
  • You can connect with your google sheets.
  • Much more
Let's make the API first
    1. Open google drive in your favorite browser. Click on the “New”, then select “google apps script”.
    1. You can rename the file if you want. (optional).
  1. Delete all pre-code.
    1. Past the google apps script code here which provide in below.
  1. Click the save icon.
  2. After saving the code you don’t see any alert icon on this part.(see in Image)
  3. Click on the deploy button.
Google Apps Script Code
// kodular coder
//kodularcoder.web.app
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");
};
  1. Click on “Done”.
  2. All done.
Let's move to kodular
    1. Open your :kodular:kodular project.
  1. For testing, you need 3 components. ( Web, Button and Notifier );
  1. Copy our block in your project, and it’s ready to test.
    NOTE: Don’t change the white mark section ( ! importent );

Details: We send a post request in API by web component. If our request succeeded then we got “success” as a response content. Otherwise, the request is failed due to some basic reasons. Such as internet connection error, wrong email address, wrong API, etc.

If I have done something wrong, please let me know so that I can correct my mistake. Because I am not a professional.

Thank you all :blue_heart: :blue_heart:

15 Likes

Nice work @RDR_SA

1 Like

Thanks for this guide, This guide brought my app back to live. :+1:

It is worth noting that:

  • all emails will be sent from the gmail account that created/authenticated the script
  • A "free" google account has a quota of 100 emails per 24 hours
1 Like

good leadership

Hi, I did this, it worked at first, but when I turned on two-step verification in the e-mail I entered, it broke down, is it about him or is there another mistake?

I advise you to use GmailApp instead of MailApp; you might not be able to receive the email if you’re using MailApp with an @gmail.com address.

Can you show me how to use it in App scripts and codes? I don’t understand how to do it.

I was directing my reply at the OP’s tutorial, pointing out that he should use GmailApp instead…

1 Like

There is a place on the site that says Email or something, app scriptemi will be written

@RDR_SA can you help me please why am i getting this error

Hi friends, my mistake in these pictures is Mail Sender. I want to do it, but I get an error when I try to send the mail. @RDR_SA




at first mine was catching everything fine but then there was an error then i changed the script account then it got there i’m sure there will be an error later