本文整理汇总了Python中mail.Mail.send_template_with_from_name方法的典型用法代码示例。如果您正苦于以下问题:Python Mail.send_template_with_from_name方法的具体用法?Python Mail.send_template_with_from_name怎么用?Python Mail.send_template_with_from_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mail.Mail
的用法示例。
在下文中一共展示了Mail.send_template_with_from_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: send_invitation_to_prospect_mail
# 需要导入模块: from mail import Mail [as 别名]
# 或者: from mail.Mail import send_template_with_from_name [as 别名]
def send_invitation_to_prospect_mail(to_dest, moment_name, user_infos, moment_url, description, moment_day, moment_month):
m = Mail()
contenu = unicode('vous invite à','utf-8')
subject = "%s" % (moment_name)
template_name = constants.INVITATION_PROSPECT_TEMPLATE
template_args = []
#Global Var
global_merge_vars = []
user_name = user_infos["firstname"]+" "+user_infos["lastname"]
global_name = {
"name" : "host_name",
"content" :user_name
}
global_merge_vars.append(global_name)
global_photo = {
"name" : "host_photo",
"content" : user_infos["photo"]
}
global_merge_vars.append(global_photo)
global_moment = {
"name" : "moment_name",
"content" : moment_name
}
global_merge_vars.append(global_moment)
global_moment_url = {
"name" : "moment_url",
"content" : moment_url
}
global_merge_vars.append(global_moment_url)
global_moment_description = {
"name" : "moment_descri",
"content" : "%s" % description
}
global_merge_vars.append(global_moment_description)
global_moment_day = {
"name" : "moment_day",
"content" : moment_day
}
global_merge_vars.append(global_moment_day)
global_moment_momth = {
"name" : "moment_month",
"content" : constants.MONTH_YEAR_FR[moment_month]
}
global_merge_vars.append(global_moment_momth)
m.send_template_with_from_name(subject, user_name, template_name, template_args, to_dest, global_merge_vars)