问题描述
我正在使用Google表格发送带有Google脚本(Gmailapp)的消息。由于电子邮件是用波斯语撰写的,因此应从右到左显示;但是,这不是我所期望的。你有什么想法可以让它成为rtl吗?
function sendEmails2() {
var sheet = SpreadsheetApp.getActiveSheet();
var startRow = 2; // First row of data to process
var numRows = 2; // Number of rows to process
// Fetch the range of cells A2:B3
var datarange = sheet.getRange(startRow,1,numRows,3);
// Fetch values for each row in the Range.
var data = datarange.getValues();
for (var i = 0; i < data.length; ++i) {
var row = data[i];
var emailAddress = row[1]; // First column
var message = 'سلام '+row[0]+' عزیز،'+" \n"+row[2];
var html= '<body>' + '<h1 dir="rtl"> message </h1>' + '</body>'
var alias=GmailApp.getAliases()
var emailSent = row[4]; // Third column
if (emailSent !== EMAIL_SENT) { // Prevents sending duplicates
var subject = 'نظرسنجی';
GmailApp.sendEmail(emailAddress,subject,message,{from: alias[0],htmlbody: html});
sheet.getRange(startRow + i,4).setValue(EMAIL_SENT);
// Make sure the cell is updated right away in case the script is interrupted
SpreadsheetApp.flush();
}
}
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)