简体   繁体   English

电子邮件中的粗体字-Google Spreadsheet

[英]Bold text in email - Google Spreadsheet

I'm looking some way to bold text in email and when I open the msgBox . 当我打开msgBox时,我正在寻找某种在电子邮件中加粗文本的方法 I want bold only headlines, like in picture below: 我只想要大胆的标题,如下图所示:

在此处输入图片说明

this is my script, you choose some cell in row that interests you and run the function. 这是我的脚本,在行中选择一些您感兴趣的单元格并运行该函数。 Function show information about data from every cell in row, like inforamtion about "Name" and "email". 函数显示有关来自行中每个单元格的数据的信息,例如有关“名称”和“电子邮件”的信息。 Then if you push send it will send email with this informations. 然后,如果您按下发送,它将发送包含此信息的电子邮件。 I want bold headlines for better clarity. 我想要大胆的标题以便更清晰。

 function sendEmail(){ var ss = SpreadsheetApp.getActiveSpreadsheet(); var fr1 = ss.getSheetByName("Sheet1"); var cell = ss.getActiveCell().getRow(); var lastColumn = fr1.getLastColumn(); var lastRowValues = fr1.getRange(cell,1,1,lastColumn).getValues(); var Nr = lastRowValues[0][0]; var Data = lastRowValues[0][1]; var Information = lastRowValues[0][2]; var Name = lastRowValues[0][3]; var email = lastRowValues[0][4]; var urlOfSS = ss.getUrl(); var message = "Message" + "\\n " + "\\nNr: " + Nr + "\\nData: " + Data + "\\nInformation: " + Information + "\\nName " + Name + "\\nEmail: " + email + "\\n " + "\\n Link to spreadsheet:" + "\\n " + urlOfSS; var emails = ss.getSheetByName("Sheet1"); var numRows = emails.getLastRow(); var emailTo = email; var subject = "Zgłoszenie FAS - " + Nr; if (email == ""){ Browser.msgBox('This row is empty - Choose another'); } else { var ui = SpreadsheetApp.getUi(); var l = ss.getSheets()[0] var response = ui.alert('Email', "Do you want email \\nNr: " + l.getRange(cell, 1).getValue() + "\\nData: " + l.getRange(cell, 2).getValue() + "\\nInforamtion: " + l.getRange(cell, 3).getValue() + "\\nName: " + l.getRange(cell, 4).getValue(), ui.ButtonSet.YES_NO); if (response == ui.Button.YES) { GmailApp.sendEmail(emailTo, subject, message); } else { Logger.log('The user clicked "No" or the dialog\\'s close button.'); } } } 

Regards 问候

If I understand the requirement, Only the side headers(underlined in the screenshot) needs decoration. 如果我理解此要求,则仅需要侧面标题(在屏幕截图中带下划线)需要装饰。

While going through the Google Apps Scripts - Documentation, I came through this. 在浏览Google Apps脚本-文档时,我遇到了这个问题。 Hope this helps you. 希望这对您有所帮助。

Using the HtmlServices & HtmlOutputFromFile() would fulfill your requirement. 使用HtmlServices和HtmlOutputFromFile()将满足您的要求。

Please refer to Custom Dialogs. 请参考自定义对话框。 This would help you https://developers.google.com/apps-script/guides/dialogs 这将帮助您https://developers.google.com/apps-script/guides/dialogs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM