platzky 0.2.17__py3-none-any.whl → 0.2.18__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: platzky
3
- Version: 0.2.17
3
+ Version: 0.2.18
4
4
  Summary: Not only blog engine
5
5
  License: MIT
6
6
  Requires-Python: >=3.10,<4.0
@@ -19,6 +19,7 @@ Requires-Dist: aiohttp (>=3.9.5,<4.0.0)
19
19
  Requires-Dist: google-cloud-storage (>=2.5.0,<3.0.0)
20
20
  Requires-Dist: gql (>=3.4.0,<4.0.0)
21
21
  Requires-Dist: humanize (>=4.9.0,<5.0.0)
22
+ Requires-Dist: platzky-sendmail (>=0.1.1,<0.2.0)
22
23
  Requires-Dist: pydantic (>=2.7.1,<3.0.0)
23
24
  Description-Content-Type: text/markdown
24
25
 
@@ -17,7 +17,6 @@ platzky/platzky.py,sha256=A_ku8ZFseCde12vXL9PLNn9ybMszXDcBIqZbWj1rxMo,4996
17
17
  platzky/plugin_loader.py,sha256=kYLaBOc8MA4b0T2yhVpSxZsX1rTxfcAnyGJCNKPGBXY,2428
18
18
  platzky/plugins/google-tag-manager/entrypoint.py,sha256=Z4npXtmCdrSuUG_ZvFdPhUZg5QcwIPGQWj9Uw9dcm8A,1021
19
19
  platzky/plugins/redirections/entrypoint.py,sha256=yoqHsRLqRALdICs5_UMSREkfEo1Lbsjj9tqEA7dsseg,1555
20
- platzky/plugins/sendmail/entrypoint.py,sha256=16GszfLaYhVUSuCdL4SPVKYN9-mONp-hK5ZWSiLluPo,1215
21
20
  platzky/seo/seo.py,sha256=N_MmAA4KJZmmrDUh0hYNtD8ycOwpNKow4gVSAv8V3N4,2631
22
21
  platzky/static/blog.css,sha256=TrppzgQbj4UtuTufDCdblyNTVAqgIbhD66Cziyv_xnY,7893
23
22
  platzky/static/styles.css,sha256=U5ddGIK-VcGRJZ3BdOpMp0pR__k6rNEMsuQXkP4tFQ0,686
@@ -33,6 +32,6 @@ platzky/templates/post.html,sha256=GSgjIZsOQKtNx3cEbquSjZ5L4whPnG6MzRyoq9k4B8Q,1
33
32
  platzky/templates/robots.txt,sha256=2_j2tiYtYJnzZUrANiX9pvBxyw5Dp27fR_co18BPEJ0,116
34
33
  platzky/templates/sitemap.xml,sha256=iIJZ91_B5ZuNLCHsRtsGKZlBAXojOTP8kffqKLacgvs,578
35
34
  platzky/www_handler.py,sha256=pF6Rmvem1sdVqHD7z3RLrDuG-CwAqfGCti50_NPsB2w,725
36
- platzky-0.2.17.dist-info/METADATA,sha256=vY11shggzwZqaPt6-6Cize6KyLhL4T2yjftJXz-LstM,1643
37
- platzky-0.2.17.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
38
- platzky-0.2.17.dist-info/RECORD,,
35
+ platzky-0.2.18.dist-info/METADATA,sha256=SuoQGVWFGG_sFQ_YxyIqaZ2kni2Mh9ARrouJu03vmUk,1692
36
+ platzky-0.2.18.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
37
+ platzky-0.2.18.dist-info/RECORD,,
@@ -1,39 +0,0 @@
1
- import smtplib
2
-
3
- from pydantic import BaseModel, Field
4
-
5
-
6
- def send_mail(sender_email, password, smtp_server, port, receiver_email, subject, message):
7
- full_message = f"From: {sender_email}\nTo: {receiver_email}\nSubject: {subject}\n\n{message}"
8
- server = smtplib.SMTP_SSL(smtp_server, port)
9
- server.ehlo()
10
- server.login(sender_email, password)
11
- server.sendmail(sender_email, receiver_email, full_message)
12
- server.close()
13
-
14
-
15
- class SendMailConfig(BaseModel):
16
- user: str = Field(alias="sender_email")
17
- password: str = Field(alias="password")
18
- server: str = Field(alias="smtp_server")
19
- port: int = Field(alias="port")
20
- receiver: str = Field(alias="receiver_email")
21
- subject: str = Field(alias="subject")
22
-
23
-
24
- def process(app, config):
25
- plugin_config = SendMailConfig.model_validate(config)
26
-
27
- def notify(message):
28
- send_mail(
29
- sender_email=plugin_config.user,
30
- password=plugin_config.password,
31
- smtp_server=plugin_config.server,
32
- port=plugin_config.port,
33
- receiver_email=plugin_config.receiver,
34
- subject=plugin_config.subject,
35
- message=message,
36
- )
37
-
38
- app.add_notifier(notify)
39
- return app