Skip to content

Commit

Permalink
Add translation keys for test and shipment emails and make them lazy …
Browse files Browse the repository at this point in the history
…lookups
  • Loading branch information
luisramos0 committed Jul 14, 2020
1 parent f66538d commit a6b7850
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 21 deletions.
1 change: 0 additions & 1 deletion app/mailers/spree/base_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ class BaseMailer < ActionMailer::Base
# Inline stylesheets
include Roadie::Rails::Automatic

# Define layout
layout 'mailer'

def from_address
Expand Down
12 changes: 6 additions & 6 deletions app/views/spree/shipment_mailer/shipped_email.html.haml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
= Spree.t('shipment_mailer.shipped_email.dear_customer')
= t('.dear_customer')

= Spree.t('shipment_mailer.shipped_email.instructions')
= t('.instructions')

= "============================================================"
= Spree.t('shipment_mailer.shipped_email.shipment_summary')
= t('.shipment_summary')
= "============================================================"
- @shipment.manifest.each do |item|
= item.variant.sku
Expand All @@ -12,8 +12,8 @@
= "============================================================"

- if @shipment.tracking
= Spree.t('shipment_mailer.shipped_email.track_information', tracking: @shipment.tracking)
= t('.track_information', tracking: @shipment.tracking)
- if @shipment.tracking_url
= Spree.t('shipment_mailer.shipped_email.track_link', url: @shipment.tracking_url)
= t('.track_link', url: @shipment.tracking_url)

= Spree.t('shipment_mailer.shipped_email.thanks')
= t('.thanks')
4 changes: 2 additions & 2 deletions app/views/spree/test_mailer/test_email.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= t('test_mailer.test_email.greeting')
= t('.greeting')
= "================"

= t('test_mailer.test_email.message')
= t('.message')
38 changes: 26 additions & 12 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3508,6 +3508,32 @@ See the %{link} to find out more about %{sitename}'s features and to start using
invoice_email:
hi: "Hi %{name}"
invoice_attached_text: Please find attached an invoice for your recent order from
user_mailer:
reset_password_instructions:
request_sent_text: |
A request to reset your password has been made.
If you did not make this request, simply ignore this email.
link_text: >
If you did make this request just click the link below:
issue_text: |
If the above URL does not work try copying and pasting it into your browser.
If you continue to have problems please feel free to contact us.
confirmation_instructions:
subject: "Please confirm your OFN account"
shipment_mailer:
shipped_email:
dear_customer: "Dear Customer,"
instructions: "Your order has been shipped"
shipment_summary: "Shipment Summary"
subject: "Shipment Notification"
thanks: "Thank you for your business."
track_information: ! "Tracking Information: %{tracking}"
track_link: ! "Tracking Link: %{url}"
test_mailer:
test_email:
greeting: "Congratulations!"
message: "If you have received this email, then your email settings are correct."
subject: "Test Mail"
order_state:
address: address
adjustments: adjustments
Expand All @@ -3529,18 +3555,6 @@ See the %{link} to find out more about %{sitename}'s features and to start using
ended: ended
paused: paused
canceled: cancelled
user_mailer:
reset_password_instructions:
request_sent_text: |
A request to reset your password has been made.
If you did not make this request, simply ignore this email.
link_text: >
If you did make this request just click the link below:
issue_text: |
If the above URL does not work try copying and pasting it into your browser.
If you continue to have problems please feel free to contact us.
confirmation_instructions:
subject: Please confirm your OFN account
users:
form:
account_settings: Account Settings
Expand Down

0 comments on commit a6b7850

Please sign in to comment.