How to solve a sentence moved into a new line automatically (Gmail automated by GAS)

23 views
Skip to first unread message

TT

unread,
Nov 20, 2022, 5:00:25 AM11/20/22
to Google Apps Script Community
Hello.

I made GAS which makes an announcement email automatically.
However, some sentences are automatically moved into a new line although I do not intend to do it.
The example is below
【Script】
Script of the target sentence.png

【Actual sentence in Gmail】
Example of the sentence.png
As you can see from the pictures above, I used "\n" to indicate when to begin on a new line, but in the actual sentence, "on" is the last word in the first line and the new line began with "the".

Could you please give me any advice on how to solve it?

Thank you for your cooperation.


Robert Rawlingson

unread,
Nov 20, 2022, 5:14:05 AM11/20/22
to google-apps-sc...@googlegroups.com
I dont know if this helps
\nAppointment Time  ${data[0][10]}
this selects a new line then gives a description of what follows followed by 2 spaces then the date contained in row 0 col 10
Be Safe

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/6847c90a-264c-445d-a64b-a18837f00641n%40googlegroups.com.


--
Bob Rawlingson

WhatsApp / SMS Text



Robert Rawlingson

unread,
Nov 20, 2022, 5:24:20 AM11/20/22
to google-apps-sc...@googlegroups.com
Column count starts from 0 in Javascript

On Sun, 20 Nov 2022 at 10:00, TT <tiger.ti...@gmail.com> wrote:
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/6847c90a-264c-445d-a64b-a18837f00641n%40googlegroups.com.

Tiger.8989

unread,
Nov 23, 2022, 5:07:06 AM11/23/22
to Google Apps Script Community
Dear Bob, 

Thank you for giving me your advice. 
I put your suggested statement into the script but it did not work well.
I think that my usage is wrong. 

Below is the target statement from the script that did not work.
let _body = "Dear ${Advisor Last Name-sensei}\n(Cc: ${Student Last Name-san})\n\nThis is to inform you of the result of your credit transfer.${data[0][10]}\nPlease access the link below and refer to your sheet.${data[1][10]}\n${CML Link}\n・Modifications about courses and credits are already done in the sheet (if there are any).${data[2][10]}\n・You can check comments by the Final Approvers and Administration on the columns 'Comments'.${data[3][10]}\n【NOTE】Please note the following points about what students have to do after departure.${data[4][10]}\n\nThank you for your understanding and cooperation.\nSincerely,";

Could you please let me know how I can improve the above script to make it work?

Thank you for your cooperation.

2022年11月20日日曜日 19:24:20 UTC+9 bobr...@gmail.com:
Reply all
Reply to author
Forward
0 new messages