处理通知发送的django包

unicef_notification的Python项目详细描述


#unicef notification

通知是一个提供通知发送处理的库。




“联合国儿童基金会通知”,
]


“backends”:{
“default”:“dCelery嫒email.backends.Celeryemailbackend”
}


通过添加“emailTemplateRoader”并将“app嫒dirs”标记为“false”来更新设置中的“templates”
“templates=[

“app嫒dirs”:false,#错误,因为我们在
“选项”下手动设置加载程序:{
“加载程序”:[

“django.template.loaders.app_directories.loader”,
“unicef_notification.loaders.emailtemplateloader”,


]





unicef_notification_template_dir='通知'


这是要在应用程序中放置通知模板的目录。
这些模板使用“上载通知”管理命令加载。



unicef_notification_email_template_prefix='email templates/'


\u用法


在安装程序中定义的'unicef_notification_template_dir'中创建通知模板。

默认值=
“说明”:“示例通知”,
“主题”:“通知主题”,
“内容”:“通知内容”,
“HTML内容”:“HTML格式的通知内容”,
}


更新通知;



使用模板发送通知;

导入使用模板发送通知(模板

context={}
使用模板发送通知(模板
[“到@example.com”],
“<;模板名称>;”,
context,



不使用模板发送通知;

来自unicef_notification.utils import send_notification

send_notification(
[“to@example.com”],
subject=“subject of notification”,
content=“content of notification”,
html_content=“html格式的通知内容”,




`有关编码标准的完整详细信息。

对代码运行检查,以确保代码符合


$make lint





$make test

coverage report可在“build/coverage”目录中查看,并可使用以下项生成;



\project links

-continuos integration-https://circleci.com/gh/unicef/unicef/unicef notification/tree/develop
-源代码-https://github.com/unicef/unicef notification

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
jcombobox如何在java中的另一个选项卡中执行按钮操作时更新ComboBox   javascript AJAX正在使用POST映射将所有空数据发送到Spring控制器?   java使用WebPush Api部署了两次类似的战争,导致InvalidKeySpecException:无法识别密钥规范   如果值相同,则停止while循环   为什么完整数组在部分初始化时不在Java中打印?   java我可以使用@OneToMany(mappedBy=“…”)吗在@MappedSuperclass中?   在Oracle jdbc驱动程序中注册用于透明应用程序故障切换的java回调   用Java程序分发用JavaDB制作的数据库   java如何使用运算符转换字符串   Android,Java只从字符串数组中获取最后一个单词   java Bluetooth回调函数onCharacteristicRead未对另一个使用<API21的活动进行意向调用。不是在棉花糖里   java如何使用Gradle设置环境变量,而不是在Exec范围内?   JavaRSA密钥块包装器:javax。加密。BadPaddingException:解密错误   java监控弹性搜索可能的响应   java使jpa-oneToMany关系有效?   Spring应用程序中JSP中HashMap的java迭代HashMap   在或多个运营商SAP Java中   java用jsp格式发送句子(字符串)