Concatenating Name and String to make a custom subject for each email. #43

Closed
opened 2025-10-14 16:23:17 -06:00 by navan · 0 comments
Owner

Originally created by @sgebr01 on 11/26/2021

I'm trying to concatenate the name of the person that is submitted in the form and my own string( - form submitted), to make a custom subject for each email(John Doe - Form Submitted). However, when I tried it myself with the code that is placed below, it didn't work, the name wasn't inserted in the subject at all. Here's the code I was using.

if (sendEmailTo) {
      MailApp.sendEmail({
        to: String(sendEmailTo),
        subject: String(mailData.name) + " - Form Submitted" ),
        replyTo: String(mailData.email), 
        htmlBody: formatMailBody(mailData, dataOrder)
      }); 

Why isn't it working? Thanks.

*Originally created by @sgebr01 on 11/26/2021* I'm trying to concatenate the name of the person that is submitted in the form and my own string( - form submitted), to make a custom subject for each email(John Doe - Form Submitted). However, when I tried it myself with the code that is placed below, it didn't work, the name wasn't inserted in the subject at all. Here's the code I was using. ```js if (sendEmailTo) { MailApp.sendEmail({ to: String(sendEmailTo), subject: String(mailData.name) + " - Form Submitted" ), replyTo: String(mailData.email), htmlBody: formatMailBody(mailData, dataOrder) }); ``` Why isn't it working? Thanks.
navan 2025-10-14 16:23:22 -06:00
Sign in to join this conversation.
No labels
Priority-1
Priority-1
Priority-1
Priority-1
Priority-1
Priority-1
Priority-1
Priority-1
awaiting-review
awaiting-review
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
chore
chore
discuss
discuss
discuss
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
duplicate
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
epic
epic
external-dependency
external-dependency
external-dependency
hacktoberfest-accepted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
help wanted
in-progress
in-progress
in-progress
in-review
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
merge-conflicts
merge-conflicts
please-test
please-test
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
question
spam
spam
starter
starter
starter
starter
starter
starter
starter
starter
starter
technical
technical
technical
technical
technical
user-feedback
user-feedback
user-feedback
user-feedback
user-feedback
user-feedback
wontfix
wontfix
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github/learn-to-send-email-via-google-script-html-no-server#43
No description provided.