def douban_contract_apply(sender, apply_context): """豆瓣合同号申请""" order = apply_context['order'] url = mail.app.config['DOMAIN'] + order.info_path() douban_users = User.douban_contracts() body = u""" Dear %s: 请帮忙递交法务审核合同 + 分配合同号, 谢谢~ 项目: %s 客户: %s 代理: %s 直客销售: %s 渠道销售: %s 时间: %s : %s 金额: %s 附注: 致趣订单管理系统链接地址: %s by %s\n """ % (','.join([x.name for x in douban_users]), order.campaign, order.client.name, order.jiafang_name, order.direct_sales_names, order.agent_sales_names, order.start_date_cn, order.end_date_cn, order.money, url, g.user.name) file_paths = [] if order.get_last_contract(): file_paths.append(order.get_last_contract().real_path) if order.get_last_schedule(): file_paths.append(order.get_last_schedule().real_path) send_attach_mail(u'【合同流程】%s-%s' % (order.name, u'豆瓣合同号申请'), recipients=apply_context['to'], body=body, file_paths=file_paths)
def framework_douban_contract_apply(sender, apply_context): """框架订单豆瓣合同号申请""" order = apply_context['order'] url = mail.app.config['DOMAIN'] + order.info_path() douban_users = User.douban_contracts() body = u""" Dear %s: 请帮忙递交法务审核合同 + 分配合同号, 谢谢~ 项目: 框架 代理集团: %s 直客销售: %s 渠道销售: %s 时间: %s : %s 金额: %s 附注: 致趣订单管理系统链接地址: %s by %s\n """ % (','.join([x.name for x in douban_users]), order.group.name, order.direct_sales_names, order.agent_sales_names, order.start_date_cn, order.end_date_cn, order.money, url, g.user.name) file_paths = [] # if order.get_last_contract(): # file_paths.append(order.get_last_contract().real_path) if order.get_last_schedule(): file_paths.append(order.get_last_schedule().real_path) send_attach_mail(u'【合同流程】%s-%s' % (order.name, u'豆瓣合同号申请'), recipients=apply_context['to'], body=body, file_paths=file_paths)
def contract_apply_douban(sender, apply_context): """豆瓣直签豆瓣、关联豆瓣订单 发送豆瓣合同管理员""" order = apply_context['order'] file_paths = [] if order.get_last_contract(): file_paths.append(order.get_last_contract().real_path) if order.get_last_schedule(): file_paths.append(order.get_last_schedule().real_path) send_attach_mail(u'【合同流程】%s-%s' % (order.name, apply_context['action_msg']), recipients=apply_context['to'], body=order.douban_contract_email_info( title=u"请帮忙打印合同, 谢谢~"), file_paths=file_paths)
def contract_apply_douban(sender, apply_context): """豆瓣直签豆瓣、关联豆瓣订单 发送豆瓣合同管理员""" order = apply_context['order'] file_paths = [] if order.get_last_contract(): file_paths.append(order.get_last_contract().real_path) if order.get_last_schedule(): file_paths.append(order.get_last_schedule().real_path) send_attach_mail( u'【合同流程】%s-%s' % (order.name, apply_context['action_msg']), recipients=apply_context['to'], body=order.douban_contract_email_info(title=u"请帮忙打印合同, 谢谢~"), file_paths=file_paths)
def contract_apply_douban(sender, apply_context): """豆瓣直签豆瓣、关联豆瓣订单 发送豆瓣合同管理员""" order = apply_context['order'] file_paths = [] if order.get_last_contract(): file_paths.append(order.get_last_contract().real_path) if order.get_last_schedule(): file_paths.append(order.get_last_schedule().real_path) douban_contracts = User.douban_contracts() to_users = [k.email for k in User.douban_contracts()] + \ _get_active_user_email(User.contracts()) + \ _get_active_user_email(order.direct_sales + order.agent_sales + [order.creator]) send_attach_mail( u'【合同流程】%s-%s' % (order.name, apply_context['action_msg']), recipients=to_users, body=order.douban_contract_email_info(title=u"请帮忙打印合同, 谢谢~"), file_paths=file_paths)
def contract_apply_douban(sender, apply_context): """豆瓣直签豆瓣、关联豆瓣订单 发送豆瓣合同管理员""" order = apply_context['order'] file_paths = [] if order.get_last_contract(): file_paths.append(order.get_last_contract().real_path) if order.get_last_schedule(): file_paths.append(order.get_last_schedule().real_path) douban_contracts = User.douban_contracts() to_users = [k.email for k in User.douban_contracts()] + \ _get_active_user_email(User.contracts()) + \ _get_active_user_email(order.direct_sales + order.agent_sales + [order.creator]) send_attach_mail(u'【合同流程】%s-%s' % (order.name, apply_context['action_msg']), recipients=to_users, body=order.douban_contract_email_info( title=u"请帮忙打印合同, 谢谢~"), file_paths=file_paths)