-
Notifications
You must be signed in to change notification settings - Fork 1
/
Html_plain_templates.py
131 lines (114 loc) · 4.83 KB
/
Html_plain_templates.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# *****************************************Template1*************************************************************************************
def html_tamplate(book_title, subject, img_link, summary, practical_use, book_link ):
html_email = f"""
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{book_title}</title>
<style>
body {{
font-family: Arial, sans-serif;
font-size: 16px;
line-height: 2.2;
width: 100%;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}}
h1 {{
font-size: 24px;
margin-top: 30px;
margin-bottom: 20px;
}}
.container p {{
font-size:16px;
line-height: 2.2;
}}
.container {{
max-width: 600px;
margin: 0 auto;
padding-top:5px;
padding-bottom:30px;
padding-right:30px;
padding-left:30px;
background-color: #F7FCFD;
border-style: outset;
border-radius: 5px;
border-width:2px;
line-height: 1.5;
}}
.signature {{
font-family: cursive;
font-size: 1rem;
line-height: 1;
}}
.bottom {{
background-color: #333;
color: #fff;
padding: 20px;
font-size: 14px;
}}
</style>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="max-width: 600px; margin: 0 auto;">
<tr>
<td>
<div class="container">
{''.join([f'<p>{sentence}</p>' for sentence in summary])}
<h3>Book Nugget 📖 </h3>
{''.join([f'<p>{sentence}</p>' for sentence in practical_use])}
</div>
</td>
</tr>
<tr>
<td class="bottom">
<p class="signature">"Stay Nuggety"</p>
<p class="signature">- Jorge A. Gil </p>
<p> © 2023 JAG LLC. All rights reserved.</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
"""
return html_email
# *****************************************Template2*************************************************************************************
def plain_text_tamplate(subject, img_link,summary, practical_use, book_link):
plain_text_email = f"""{subject} {img_link} {summary} Real One: {practical_use} More Real Ones >>>>>{book_link} Read me!"""
return plain_text_email
def simple_html_tamplate(book_title,subject, img_link, summary, practical_use ):
html_email = f"""
<!DOCTYPE html>
<html>
<head>
<title>{subject}</title>
</head>
<body style="font-family: Arial, Helvetica, sans-serif; background-color: #f2f2f2;">
<div style="max-width: 600px; margin: 0 auto;padding: 10px">
<div style="padding: 20px; line-height:2.2; font-size: 16px; background-color: #ffffff;">
<img style="float: left; margin-right: 20px;" src={img_link} alt={book_title}>
{''.join([f'<p>{sentence}</p>' for sentence in summary])}
<h3>Book Nugget 📖 </h3>
{''.join([f'<p>{sentence}</p>' for sentence in practical_use])}
</div>
<div style="font-size: 14px; margin-left: 20px; font-weight: bold;">
<p>"Stay Nuggety"</p>
<p>Jorge A. Gil </p>
<p> © 2023 JAG LLC. All rights reserved.</p>
</div>
</div>
</body>
</html>
"""
return html_email
def simple_plain_text_tamplate(book_title,subject, img_link,summary, practical_use):
plain_text_email = f"""{subject} {img_link} {book_title} {summary} Book Nugget 📖 {practical_use} Stay Nuggety Jorge A. Gil © 2023 JAG LLC. All rights reserved."""
return plain_text_email