如何在Magento电子邮件模板中获取当前日期?
{{var dateAndTime}}不起作用.我需要获取发送电子邮件的当前日期.
我有一个带有多个分号的字符串。
'firstline: abc \n secondline: bcd \n thirdline: efg'
Run Code Online (Sandbox Code Playgroud)
我想使用 Xlsx Writer 在 excel 单元格中编写此字符串,如下所示。
第一行:abc
第二行:bcd
第三行:efg
这就是我所做的。
description_combined =
'''
firstline: abc
secondline: bcd
thirdline: efg
'''
spanInserted = []
spanInserted = description_combined.split("\n")
result = ''
for spans in spanInserted:
strr1 = '{}:'.format(spans.split(":")[0])
strr2 = spans.split(":")[1]
result += '''bold , "{}" , "{}" ,'''.format(str(strr1),str(strr2))
result = result[:-1]
# print result
worksheet.write_rich_string('A1', result)
Run Code Online (Sandbox Code Playgroud)
这是我在excel单元格中得到的结果:
粗体,“第一行:”,“abc”,粗体,“第二行:”,“bcd”,粗体,“第三行:”,“efg”