Glider
Loading...
Searching...
No Matches
glider
src
report_generation
BodyEmail.py
Go to the documentation of this file.
1
2
class
BodyEmail
():
3
"""
4
Builds the body email according to kind of report
5
"""
6
def
report_email
(period, link):
7
"""Builds the body for reports email. The format used is html
8
9
Args:
10
period (str): month and year when sales were processed
11
link (str): presigned link to download report
12
Returns: body (str)
13
"""
14
body =
"""<!DOCTYPE html>
15
<html>
16
<body>
17
<div style="padding:20px 0px">
18
<div style="height: 600px;width:600px">
19
<div style="text-align:left;">
20
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRMK6NxbpGlgtJWdMreEPdgJ4sHeCXkF2FQj--4Vu4iOA&s" style="height: 153px;">
21
<h3>Your report for {} is ready</h3>
22
<p>Hello there! </p>
23
<p>Thanks for using our File generator service. Your final report is now ready to be downloaded.</p>
24
<p>Please click on the link below to download your report.</p>
25
<a href="{}"><b>Download your report here</b></a>
26
<p>
27
<b>
28
<u>NOTE</u>
29
</b>: the link will expire in <b style="color:orange;">24 hours</b> so please do it as soon as you get the email.
30
</p>
31
<p>If you have any issue, question or feature request, please raise a ticket by emailing us at <i>support@ottomate.me.</i>
32
<p>
33
<p>Thanks!</p> - The OTTO team
34
</div>
35
</div>
36
</div>
37
</body>
38
</html>"""
.format(period, link)
39
return
body
40
41
def
unmatched_email
(period, link, lines, files):
42
"""Builds the body for unmatched lines report email. The format used is html
43
44
Args:
45
period (str): month and year when sales were processed
46
link (str): presigned link to download report
47
lines (int): total lines which don't match with catalogue
48
files (int): files which have lines not matched
49
Returns: body (str)
50
"""
51
body =
"""<!DOCTYPE html>
52
<html>
53
<body>
54
<div style="padding:20px 0px">
55
<div style="height: 600px;width:600px">
56
<div style="text-align:left;">
57
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRMK6NxbpGlgtJWdMreEPdgJ4sHeCXkF2FQj--4Vu4iOA&s" style="height: 153px;">
58
<h3>Your report for Unmatched sales for {} is ready</h3>
59
<p>Hello there! </p>
60
<p>Thanks for using our Unmatched File generator service. Your final file is now ready to be downloaded.</p>
61
<p>We found {} sales contained in {} files that were not matched with your catalogue.</p>
62
<p>Please click on the link below to download your report.</p>
63
<a href="{}"><b>Download your report here</b></a>
64
<p>
65
<b>
66
<u>NOTE</u>
67
</b>: the link will expire in <b style="color:orange;">24 hours</b> so please do it as soon as you get the email.
68
</p>
69
<p>If you have any issue, question or feature request, please raise a ticket by emailing us at <i>support@ottomate.me.</i>
70
<p>
71
<p>Thanks!</p> - The OTTO team
72
</div>
73
</div>
74
</div>
75
</body>
76
</html>"""
.format(period, lines, files, link)
77
return
body
78
79
def
statement_email
(period, csv_link, pdf_link):
80
"""Builds the body for statements email. The format used is html
81
82
Args:
83
period (str): month and year when sales were processed
84
csv_link (str): presigned link to download csv statement
85
pdf_link (str): presigned link to download pdf statement
86
Returns: body (str)
87
"""
88
body =
"""<!DOCTYPE html>
89
<html>
90
<body>
91
<div style="padding:20px 0px">
92
<div style="height: 600px;width:600px">
93
<div style="text-align:left;">
94
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRMK6NxbpGlgtJWdMreEPdgJ4sHeCXkF2FQj--4Vu4iOA&s" style="height: 153px;">
95
<h3>Your Statement for {} is ready</h3>
96
<p>Hello there! </p>
97
<p>Thanks for using our Statement generator service. Your CSV report and PDF file are now ready to be downloaded.</p>
98
<p>Please click on the link below to download your reports.</p>
99
<a href="{}"><b>Download your CSV report here</b></a>
100
<p><a href="{}"><b>Download your PDF file here</b></a><p>
101
<p>
102
<b>
103
<u>NOTE</u>
104
</b>: the link will expire in <b style="color:orange;">24 hours</b> so please do it as soon as you get the email.
105
</p>
106
<p>If you have any issue, question or feature request, please raise a ticket by emailing us at <i>support@ottomate.me.</i>
107
<p>
108
<p>Thanks!</p> - The OTTO team
109
</div>
110
</div>
111
</div>
112
</body>
113
</html>"""
.format(period, csv_link, pdf_link)
114
return
body
src.report_generation.BodyEmail.BodyEmail
Definition
BodyEmail.py:2
src.report_generation.BodyEmail.BodyEmail.unmatched_email
unmatched_email(period, link, lines, files)
Definition
BodyEmail.py:41
src.report_generation.BodyEmail.BodyEmail.statement_email
statement_email(period, csv_link, pdf_link)
Definition
BodyEmail.py:79
src.report_generation.BodyEmail.BodyEmail.report_email
report_email(period, link)
Definition
BodyEmail.py:6
Generated by
1.12.0