相关疑难解决方法(0)

在Google Apps脚本中,如何保留用户输入的换行符?

我有一个TextArea(),我正在从中收集用户输入.

我想将此输入反馈到电子邮件中,但保留格式非常重要.如果有人将回报或段落放在一起来分隔他们的陈述,我希望将其反映在输出中.

目前,我将此输入分配给变量,然后在MailApp()调用中引用该变量.它不是通过此过程保留格式:

var user_input=e.parameter.text_area_input;

MailApp.sendEmail({
  to: "someemail@somedomain.com",
  subject: "This is a subject.",
  htmlBody: "Here is the text that was entered: <BR>" + user_input
})
Run Code Online (Sandbox Code Playgroud)

我怎样才能做到这一点?

newline return google-apps-script

1
推荐指数
1
解决办法
5751
查看次数

标签 统计

google-apps-script ×1

newline ×1

return ×1