-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add html templates #1377
Add html templates #1377
Conversation
LGTM. 👍 |
<tr> | ||
<td><%= item.variant.sku %></td> | ||
<td><%= raw(item.variant.product.name) %></td> | ||
<td><%= raw(item.variant.options_text) -%></td> |
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.
I don't believe that these two should use raw
. It is user input, so I don't think it should be trusted.
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.
If text formatting is the reason for using raw
, we probably should use sanitize
here.
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.
I used raw
because i copied from
<%= raw(item.variant.product.name) %> |
Like in other html templates, i don't use sanitize
, the only thing to do is escape the text.
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.
Valid changes I would like to merge. Could you please fix the conflicts and add a CHANGELOG entry? Thanks
Move the html template from ShippedMailer to CartonMailer (ref solidusio@9ff3f31)
7f0754e
to
5d6533c
Compare
Conflicts are fixed. CHANGELOG updated. |
@@ -21,13 +21,13 @@ | |||
<% @reimbursement.return_items.exchange_requested.each do |return_item| %> | |||
<tr> | |||
<td> | |||
<%= return_item.variant.sku %> <%= raw(return_item.variant.name) %> <%= "(#{raw(return_item.variant.options_text)})" if return_item.variant.options_text.present? %> | |||
<%= return_item.variant.sku %> <%=return_item.variant.name %> <%= "(#{return_item.variant.options_text})" if return_item.variant.options_text.present? %> |
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.
missing space
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.
Thanks for updating.
The product informations in email templates was not escaped because was used `raw` method.
99d6d23
to
682f6ae
Compare
Updated. Thanks! |
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.
Resolves #1377 Conflicts: CHANGELOG.md
Add shipped_email.html.erb
When the ShipmentMailer's template was moved under CartonMailer, only the text format was moved.
ref 9ff3f31
I change the test from:
expect(shipment_email.body).not_to include(%{Out of Stock})
in favour of
expect(shipment_email).not_to have_body_text(%{Out of Stock})
for use the default_part_body method.
Add inventory_cancellation_email.html.erb based on https://github.com/solidusio/solidus/blob/c5b9e0242291a2249ea62b046cc973b530957d51/core/app/views/spree/order_mailer/inventory_cancellation_email.text.erb