Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,17 @@ def send_authorization_request(self):

doc = frappe.get_doc(self.linked_doctype, self.linked_docname)
company = doc.company if hasattr(doc, 'company') else get_default_company()
default_letterhead = frappe.db.get_value("Company", company, "default_letter_head")
letterhead_content = ""
if default_letterhead:
letterhead_content = frappe.db.get_value("Letter Head", default_letterhead, "content")

subject = "{0} requests your authorization on {1}".format(company, self.linked_doctype)
message = frappe.render_template("templates/emails/authorization_request.html", {
"authorization_request": self,
"linked_doc": doc,
"company": company
"company": company,
"letter_head": letterhead_content
})

frappe.sendmail(recipients=[self.authorizer_email], subject=subject, message=message)
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class LicenseSearch {
return;
}

$wrapper.html(`<p class="text-muted">${cards_range_start} -
$wrapper.html(`<p class="text-muted">${cards_range_start ? cards_range_start : 1} -
${(cards_range_end >= me.total_count ? me.total_count : cards_range_end)}
of ${me.total_count}</p>`);
}
Expand Down
17 changes: 16 additions & 1 deletion bloomstack_core/templates/emails/authorization_request.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,25 @@
</head>

<body style="margin: 0;">

<table
style="max-width: 600px; margin: 0 auto; font-family: Helvetica, 'sans-serif'; color: #808080; line-height: 24px;">

<thead style="background-color: #f7f7f7;">
<tr>
<td style="padding: 40px 20px">
<div style="margin-bottom: 7px;" class="text-center">{{ letter_head }}</div>
<p style="float: right; padding-top: 25px; font-size: 21px; margin-bottom: 0;">
{% if authorization_request.status == "Request Sent" %}
Authorization Request
{% else %}
{{ authorization_request.linked_docname }}
{% endif %}
</p>
</td>
</tr>
</thead>

<tbody>
<tr>
<td>
Expand Down