Skip to content
This repository has been archived by the owner on Jul 17, 2020. It is now read-only.

(#119-2)New PlaceHolder in common/placeholders #245

Merged
merged 1 commit into from
Sep 25, 2017

Conversation

ronaldblanco
Copy link
Contributor

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!

Copy link
Contributor

@jspaine jspaine left a 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.

@@ -90,14 +89,15 @@ export default {
},

async sendReceipt(donation) {
const {items} = donation

This comment was marked as off-topic.

@@ -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.

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.

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.

@ronaldblanco
Copy link
Contributor Author

Ready.
Check now.

@jspaine
Copy link
Contributor

jspaine commented Sep 25, 2017

Thanks!

@jspaine jspaine merged commit ed5d42b into freeCodeCamp:staging Sep 25, 2017
@ronaldblanco ronaldblanco deleted the fix/119#2 branch December 6, 2017 14:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants