-
-
Save infa-sasatapathy/6a72b0b77fbe2b35f7945ad722b40309 to your computer and use it in GitHub Desktop.
generate html email content
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generate_email_html(tickets): | |
body_html = [ | |
'The following tickets are open or in code review. Please ensure their status and remaining hours are up to date.', | |
'<br><br>', | |
'<table style="border-spacing: 10px">', | |
'<tr><td>Ticket Number</td><td>Status</td><td>Time Remaining</td><td>Description</td></tr>' | |
] | |
for ticket in tickets: | |
body_html.append('<tr>') | |
body_html.append('<td><a href="' + JIRA_TICKETS_URI + '{0}">{0}</a></td>'.format(ticket['key'])) | |
body_html.append('<td>{0}</td>'.format(ticket['status'])) | |
body_html.append('<td style="text-align: right">{0} hrs</td>'.format(str(ticket['timeestimate']))) | |
body_html.append('<td>{0}</td>'.format(ticket['summary'])) | |
body_html.append('</tr>') | |
body_html.append('</table>') | |
body_html = '\n'.join(body_html) | |
return body_html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment