Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8740067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:03:53+00:00 2026-06-13T11:03:53+00:00

I am trying to change one word from a template I have in a

  • 0

I am trying to change one word from a template I have in a spreadsheet, for the value that the user inputs through the inputbox. When I run my script it doesnt change the word, any ideas??

function sendEmails() {
 var ss = SpreadsheetApp.getActiveSpreadsheet();
var time = Browser.inputBox("Enter TIME");
var address = "albdominguez25@gmail.com";
ss.setActiveSheet(ss.getSheetByName("Templates"));
var emailTemplate = ss.getRange("B1").getValue();
//here I am trying to replace the word "TIME" on my template to the value entered on             the inputBox
emailTemplate.replace("TIME",time);
var emailSubject = "Tutorial: Simple Mail Merge";    

MailApp.sendEmail(address, emailSubject, emailTemplate);

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:03:54+00:00Added an answer on June 13, 2026 at 11:03 am

    Albert,

    I believe the source of your replace is not assigning the result of the emailTemplate.replace to a variable.

    I also did a little bit to the SpreadsheetApp call. Depends on what you are after of course.

    Jim

    function sendEmails() {
      var emailTemplate = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Templates").getRange("B1").getValue();
      var time = Browser.inputBox("Enter TIME");
      var address = "jcampbell@neonova.net";
      emailTemplate = emailTemplate.replace("TIME",time);
      var emailSubject = "Tutorial: Simple Mail Merge";    
    
      MailApp.sendEmail(address, emailSubject, emailTemplate);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to change an XML file from one format to another and
I would have thought this one would be simple but I'm trying to change
I'm trying to have a div's left property change by its self - one
I am trying to change one of the legacy code that declares everything in
I have a txt file that has a change-log.I'm trying to display the new
I'm trying to change the content of a ContentPresenter to one of my View
I'm trying to change the back button to a custom one. If I create
I am trying to modify the System.Drawing.Printing.PrinterSettings object that I get from the System.Windows.Forms.PrintDialog
I am trying to change the body background color when the user changes the
I have create to String array one is word another is sentence. <resources> <string-array

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.