-
-
Notifications
You must be signed in to change notification settings - Fork 189
(#119-3)To make it look a bit more receipt like, table with EIN #250
Conversation
I meant it should be part of the receipt placeholder. You can't edit tables with Quill and I'm not sure what'll happen if you insert one into the editor like that. What does it look like!? |
In the console.log looks well (the same way that the other). |
I mean what does it look like in the email editor? I think it should be in the same placeholder as the receipt. |
I will be checking. |
2815125
to
c4eda1a
Compare
Hey @jspaine check now, I did create a new placeholder I think it is a better solution (as I understand) Thanks. |
common/placeholders.js
Outdated
@@ -10,6 +10,7 @@ const placeholders = [ | |||
{id: 'url', label: 'Foodbank Website'}, | |||
{id: 'clientIntakeNumber', label: 'Client Intake Number'}, | |||
{id: 'supportNumber', label: 'Support Number'}, | |||
{id: 'EIN', label: 'EIN Number'}, |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
server/models/settings.js
Outdated
@@ -51,7 +51,7 @@ const SettingsSchema = new Schema({ | |||
EIN: { | |||
type: String, | |||
trim: true, | |||
default: '' | |||
default: '0' |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
common/placeholders.js
Outdated
let head = ['Foodbank Name','Foodbank Address','Foodbank Website','Client Intake Number', 'Support Number','EIN Number'] | ||
let tableFinal = `<table>` | ||
for (let i = 0; i < 6; i++) { | ||
tableFinal += `<tr><td><p>"${head[i]}":</p></td><td><p>"${placeholders[i]}"</p></td></tr>` |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
server/models/settings.js
Outdated
@@ -51,7 +51,7 @@ const SettingsSchema = new Schema({ | |||
EIN: { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
8a27330
to
c6ad08e
Compare
Hello @jspaine; check now, I did left the ein default: '0' because the ein placeholder have problems with an empty string. |
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!
const id = getAttr(node, 'data-id') | ||
const placeholder = placeholders.find(pl => pl.id === id) | ||
|
||
//Receipt Placeholder only | ||
if (id === 'receipt') { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
@@ -40,6 +41,13 @@ const placeholders = [ | |||
required: true, |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
c6ad08e
to
29e8680
Compare
Check now and let me know!! |
const id = getAttr(node, 'data-id') | ||
const placeholder = placeholders.find(pl => pl.id === id) | ||
|
||
//Receipt Placeholder only | ||
if (id === 'receipt') { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
common/placeholders.js
Outdated
tableFinal += `<tr><td><p>"${value[i].name}"</p></td><td><p>"${value[i].value}"</p></td></tr>` | ||
total += value[i].value | ||
for (let i = 0; i < items.length; i++) { | ||
table += `<tr><td><p>"${items[i].name}"</p></td><td><p>"${items[i].value}"</p></td></tr>` |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
@@ -40,6 +41,13 @@ const placeholders = [ | |||
required: true, |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
What was the problem with the ein field being an empty string by default? |
When ein = "" the placeholder ein does not return, it give a problem of "No placeholder with that id" or something like that. |
OK, I will be checking the rest you told me. |
Ah I think it's line 89 in the mail generator: if (!bindings[id] && placeholder.type !== placeholderTypes.ATTACHMENT) should probably be: // import {isUndefined} from 'lodash'
if (isUndefined(bindings[id]) && placeholder.type !== placeholderTypes.ATTACHMENT) |
29e8680
to
fe4bc4a
Compare
You were right with the correction on line 89. |
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.
Yeah it looks good!
common/placeholders.js
Outdated
tableFinal += `<tr><td><p>"${value[i].name}"</p></td><td><p>"${value[i].value}"</p></td></tr>` | ||
total += value[i].value | ||
for (let i = 0; i < items.length; i++) { | ||
table += `<tr><td><p>"${items[i].name}"</p></td><td><p>"${items[i].value}"</p></td></tr>` |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
fe4bc4a
to
fcf8c70
Compare
Ready. |
Thanks! |
#119 -3 To make it look a bit more receipt like, there could be another table as part of the donation receipt with the organization details and EIN number from general settings.
Solution tested locally and checked with lint command.