Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Send email using markdown

License

NotificationsYou must be signed in to change notification settings

AnswerDotAI/markdown_merge

Repository files navigation

Install

pip install markdown_merge

How to use

Provide your SMTP server settings, e.g. for AWS SES

importos
servernm='email-smtp.us-west-2.amazonaws.com'username=os.getenv('SES_SMTP_USER')password=os.getenv('SES_SMTP_PASS')smtp_cfg=dict(host=servernm,port=587,user=username,password=password,use_ssl=False,use_tls=True)

You can configure your SMTP server settings using thesmtp_cfgdictionary format shown above. The example uses AWS SES with environmentvariables for credentials.

Provide your email details

from_addr=get_addr('XXX@fastmail.com','Jeremy Howard')to_addrs= [get_addr('douglas@example.com','Douglas Adams'),get_addr('cleese@example.com','John Cleese')]inserts= [{'special':"Thanks for all the fish."},            {'special':"That was a silly walk."}]msg="""## Hello there!Here is your special message: *{special}*"""
ml=MarkdownMerge(to_addrs,from_addr,'A message',msg,smtp_cfg=smtp_cfg,inserts=inserts,test=True)

Thetest=True parameter prints the messages instead of sending them.

Send your messages

ml.send_msgs()
To: Douglas Adams <douglas@example.com>----------------------------------------## Hello there!Here is your special message: *Thanks for all the fish.*========================================To: John Cleese <cleese@example.com>----------------------------------------## Hello there!Here is your special message: *That was a silly walk.*========================================

About

Send email using markdown

Resources

License

Stars

Watchers

Forks

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp