This repository has been archived by the owner on Jul 17, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 189
(#119-2)New PlaceHolder in common/placeholders #245
Merged
Merged
Conversation
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
jspaine
reviewed
Sep 25, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
}, { | ||
identifier: pageIdentifiers.DONATION_RECEIPT, | ||
title: 'Donation Receipt', | ||
type: pageTypes.EMAIL, | ||
subject: '<p>Receipt for Your Donation to <span class="ql-placeholder-content" data-id="organization" data-label="Foodbank Name"></span></p>', | ||
body: `<p>Dear <span class="ql-placeholder-content" data-id="fullName" data-label="User Full Name"></span>,</p> | ||
` | ||
<p>Here you have a list of the donations our organization recibed from you:</p> |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
server/lib/mail/mail-helpers.js
Outdated
@@ -90,14 +89,15 @@ export default { | |||
}, | |||
|
|||
async sendReceipt(donation) { | |||
const {items} = donation |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
common/placeholders.js
Outdated
@@ -56,9 +68,22 @@ function getPlaceholders(types) { | |||
if (types.find(type => type === placeholderTypes.ATTACHMENT)) | |||
placeholders = placeholders.concat(getAttachmentPlaceholders()) | |||
|
|||
if (types.find(type => type === placeholderTypes.TABLE)) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
common/placeholders.js
Outdated
return placeholders | ||
} | ||
|
||
function table(value) { | ||
let tableFinal = `<table><tr><td><p>NAME</p></td><td><p>VALUE</p></td></tr>` |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
common/placeholders.js
Outdated
let tableFinal = `<table><tr><td><p>NAME</p></td><td><p>VALUE</p></td></tr>` | ||
let total = 0 | ||
for (let i = 0; i < value.length; i++) { | ||
tableFinal = tableFinal + `<tr><td><p>"${value[i].name}"</p></td><td><p>"${value[i].value}"</p></td></tr>` |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
ronaldblanco
force-pushed
the
fix/119#2
branch
from
September 25, 2017 20:22
a237aea
to
95760ec
Compare
Ready. |
Thanks! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To fix #119 second point:
A new placeholder for the receipt in common/placeholders. It should be required and added to the email during db seeding, like the password reset url placeholder. It should render a table with the donated items and values and total.
A new place holder was created with a table structure to send the donation detail in the receipt.
All changes where tested locally and with the lint command!