Skip to content

Commit a5a24f1

Browse files
authored
[CPT Mailer] Switch to PNGs for receipt status image (#11906)
## Summary of the problem <!-- Why are these changes being made? What problem does it solve? Link any related issues to provide more details. --> #11873 tried to fix an issue where receipt status images did not display in Gmail. While that PR did fix an issue affecting all email clients, it seems that Gmail still doesn't display the image as it is an SVG. ## Describe your changes <!-- Explain your thought process to the solution and provide a quick summary of the changes. --> Re-exported the receipt buttons from Figma as a PNG and modified the controller to send the appropriate PNG from the assets directory.
1 parent 5adbc07 commit a5a24f1

File tree

5 files changed

+8
-13
lines changed

5 files changed

+8
-13
lines changed
2.57 KB
Loading
2.08 KB
Loading

app/controllers/hcb_codes_controller.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,13 @@ def receipt_status
206206
@secret = params[:s]
207207
@hcb_code = HcbCode.find_signed(@secret, purpose: :receipt_status)
208208

209-
raise Pundit::NotAuthorizedError if @hcb_code.nil?
209+
if @hcb_code.nil?
210+
raise Pundit::NotAuthorizedError
211+
end
212+
213+
file_name = @hcb_code.missing_receipt? ? "receipt_status_upload.png" : "receipt_status_uploaded.png"
214+
215+
send_file Rails.root.join("app", "assets", "images", file_name), type: "image/png", disposition: "inline"
210216
end
211217

212218
def toggle_tag

app/views/canonical_pending_transaction_mailer/_attach_receipt.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<% if hcb_code.receipt_required? %>
22

33
<%= link_to upload_url do %>
4-
<img style="display: block; margin-top: 10px;" src="<%= receipt_status_hcb_codes_url(format: :svg, s: @cpt.local_hcb_code.signed_id(purpose: :receipt_status)) %>" alt="Click to upload your receipt">
4+
<img style="display: block; margin-top: 10px;" src="<%= receipt_status_hcb_codes_url(format: :png, s: @cpt.local_hcb_code.signed_id(purpose: :receipt_status)) %>" alt="Click to upload your receipt">
55
<% end %>
66
<p><em>This link can be used by anyone for two weeks to upload a receipt for this charge.</em></p>
77

app/views/hcb_codes/receipt_status.svg.erb

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)