Scripts

Table of Content

Auto Mail Orders - Apps Script

Google Apps Script for saving Auto Mail Orders checkouts into Google Sheets and sending emails through Gmail.

What it does

Auto Mail Orders - Apps Script.txt receives checkout data from Auto Mail Orders, saves it into Google Sheets, and sends confirmation emails to customers.

It can also send an owner notification email when Notify Owner is turned on inside Auto Mail Orders.

Before you start

You need:

  • A Google account

  • A Google Sheet for your orders

  • The Auto Mail Orders component already added to your Framer project

  • The Apps Script text file (Click on Apps Script button in the plugin and it will be copied to your clipboard)

This script uses GmailApp, so all emails are sent from the Google account that owns the script.

Steps to set up the Apps Script

Step 1

Create or open the Google Sheet where you want your orders to be stored.

Step 2

Rename the tab in the Google Sheet to "Orders" where you want the orders to populate.

Step 3

Open Extensions > Apps Script inside that Sheet.

Step 4

Paste the code from Apps Script into the Apps Script editor. (Click on Apps Script button in the plugin and it will be copied to your clipboard)

Step 5 (optional)

If you want a fallback owner email, fill OWNER_EMAIL. If not, leave it empty.

Step 6

Run testWrite() once and approve the requested Google Sheets and Gmail permissions.

Step 7

Deploy the script as a Web App. Set it to execute as you, and make sure access is allowed for anyone.

Step 8

Copy the /exec deployment URL and paste it into Apps Script URL inside Auto Mail Orders.

How it works

When a customer submits Auto Mail Orders, the component sends the order details and email content settings to this script.

The script saves the order into Google Sheets, sends a customer confirmation email, and can also send an owner notification email if that option is enabled.

The email design is controlled from the Auto Mail Orders component, while the sending itself happens through the Google account connected to the Apps Script.

Common mistakes

Tab name isn't "Orders"

If the sheet tab name is different from the value inside CONFIG (default set to "Orders"), the script will fail when trying to save the order.

There is no customer email field

This script can only send a confirmation email if Auto Mail Orders collects the customer's email address.

testWrite() was never run

If the script was never authorized, live orders may save incorrectly or emails may not send.

Expecting a branded sender address

This script sends from your Google account, not from a custom business mailbox. Use Pro Mail Orders if you want emails from a branded sender domain.

Quick setup checklist

  1. Open a Google Sheet for orders.

  2. Paste Auto Mail Orders - Apps Script.txt into Apps Script.

  3. Rename your desired tab to "Orders".

  4. Run testWrite() and approve permissions.

  5. Deploy as a Web App.

  6. Paste the /exec URL into Apps Script URL in Auto Mail Orders.

Create a free website with Framer, the website builder loved by startups, designers and agencies.