通过SendGrid/Slack发送消息的工具
ppmail的Python项目详细描述
通过SendGrid/Slack发送消息的工具
pypi包:ppmail
如果您发现任何问题或有任何改进的想法,请随时 打开一个问题,我很乐意为你调查。
安装
建议使用pip install安装工具。
安装后,命令行工具ppmail应在 你的系统路径。
pip安装
该工具在pypi中提供,可以使用pip安装:
$ pip install --user ppmail $ ppmail --help
配置
默认情况下,该工具从^{tt2}读取其配置$ 文件(可以通过设置环境变量覆盖该位置 XDG_CONFIG_HOME)。如果配置文件(或目录)不存在 然后它将被自动创建并填充示例配置 下次跑步时。
用法-帮助
$ ppmail --help usage: ppmail [--version] [--help] [--debug] [--verbose] [-S] [-f SENDER] -t RECIPIENTS [RECIPIENTS ...] [-c CC [CC ...]] [-s SUBJECT] [-H] [-F FONT_SIZE] Tool to send messages via Sendgrid/Slack optional arguments: --version show program's version number and exit --help show this help message and exit --debug debugging mode --verbose verbose logging mode -S, --slack Use Slack instead of Sendgrid -f SENDER, --from SENDER sender -t RECIPIENTS [RECIPIENTS ...], --to RECIPIENTS [RECIPIENTS ...] recipient -c CC [CC ...], --cc CC [CC ...] carbon copy recipient -s SUBJECT, --subject SUBJECT subject -H, --code send HTML formatted email/code block -F FONT_SIZE, --font-size FONT_SIZE font size in px for HTML formatted email (use with -H)
用法-cli
$ echo 'The king is dead, long live the king!' \ | ppmail -SHf 'Jon Snow' \ -t 'arya.stark@winterfell.com' \ -c 'sansa.stark@winterfell.com' \ -s 'Re: secret message'
用法-python模块
from ppmail import Mailer mailer = Mailer(slack=True) status = mailer.send( sender='Jon Snow', recipients=['arya.stark@winterfell.com'], cc=['sansa.stark@winterfell.com'], subject='Re: secret message', message='The king is dead, long live the king!', code=True )