Skip to content

Commit

Permalink
Add donation info to transactional emails. (#1202)
Browse files Browse the repository at this point in the history
# What it does

Adds a notice to the mailer layout that prompts recipients to donate to
the tool library. Fixes #1195.

# Why it is important

We're missing an opportunity to engage make it as easy as possible to
support the tool library.

# UI Change Screenshot

Before:
![image
(1)](https://github.com/chicago-tool-library/circulate/assets/3331/82c0195a-8dcb-4656-a95d-55e7ea7b72c4)

After:

![image](https://github.com/chicago-tool-library/circulate/assets/3331/0187a313-ff65-4f54-9d90-cfa808d80fcb)

# Implementation notes

* I also tweaked the styles of the various banners to remove the heavy
outlines. With 3 banners it seemed really distracting to me.

# Your bandwidth for additional changes to this PR

_Please choose one of the following to help the project maintainers
provide the appropriate level of support:_

- [x] I have the time and interest to make additional changes to this PR
based on feedback.
- [ ] I am interested in feedback but don't need to make the changes
myself.
- [ ] I don't have time or interest in making additional changes to this
work.
- [ ] Other or not sure (please describe):
  • Loading branch information
jim authored Nov 29, 2023
1 parent 7aafede commit d0d3246
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
16 changes: 14 additions & 2 deletions app/views/layouts/mailer.html.mjml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@
}
</mj-style>
<mj-style>
.donation {
background: #FFEADE;
padding: 1em;
}
.warning {
border: solid 3px gold;
background: lemonchiffon;
padding: 1em;
margin-bottom: 1em;
}
.info {
border: solid 3px #67C4E3;
background: aliceblue;
padding: 1em;
}
Expand Down Expand Up @@ -62,6 +64,16 @@
</mj-text>
</mj-column>
</mj-section>

<mj-section>
<mj-column>
<mj-text>
<div class="donation">
<%= render partial: "member_mailer/donation" -%>
</div>
</mj-text>
</mj-column>
</mj-section>

<% if @preview || !@library.email_banner1.blank? %>
<mj-section>
Expand Down
3 changes: 3 additions & 0 deletions app/views/layouts/mailer.text.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<%= yield %>

<%= HTMLToMarkdown.new.convert(render partial: "member_mailer/donation", formats: [:html]) -%>

<% unless @library.email_banner1.blank? %>

** <%= HTMLToMarkdown.new.convert(@library.email_banner1).strip -%> **
Expand Down
5 changes: 5 additions & 0 deletions app/views/member_mailer/_donation.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<strong>Did the Tool Library help you accomplish a project?</strong> Make a small donation to keep us going!
You can <%# erblint:disable TrailingWhitespace %>
<a href="https://chicagotoollibrary.app.neoncrm.com/forms/18">donate by credit card, Apple Pay, or ACH</a>, and we also have <%# erblint:disable TrailingWhitespace %>
<a href="https://www.venmo.com/u/ChiToolLibrary">Venmo</a> and <%# erblint:disable TrailingWhitespace %>
<a href="https://www.paypal.com/donate/?hosted_button_id=7X45CFLZMKBLY">PayPal</a> accounts if that's more your speed.

0 comments on commit d0d3246

Please sign in to comment.