From a99d36f68313a3e5a868c23cb27a71123bc305a6 Mon Sep 17 00:00:00 2001 From: Martin Lensment Date: Wed, 22 Apr 2015 15:18:50 +0300 Subject: [PATCH] Improve email template --- app/mailers/invoice_mailer.rb | 2 ++ app/views/invoice_mailer/invoice_email.html.erb | 6 +++++- app/views/invoice_mailer/invoice_email.text.erb | 6 +++++- app/views/layouts/mailer.html.erb | 1 - app/views/layouts/mailer.text.erb | 1 - config/locales/en.yml | 2 ++ 6 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/mailers/invoice_mailer.rb b/app/mailers/invoice_mailer.rb index 51c370994..2cc4a8b99 100644 --- a/app/mailers/invoice_mailer.rb +++ b/app/mailers/invoice_mailer.rb @@ -5,6 +5,8 @@ class InvoiceMailer < ApplicationMailer return unless test_emails.include?(invoice.billing_email) end + @invoice = invoice + attachments[invoice.pdf_name] = pdf mail(to: invoice.billing_email, subject: invoice) end diff --git a/app/views/invoice_mailer/invoice_email.html.erb b/app/views/invoice_mailer/invoice_email.html.erb index 66593ae40..02be04880 100644 --- a/app/views/invoice_mailer/invoice_email.html.erb +++ b/app/views/invoice_mailer/invoice_email.html.erb @@ -1 +1,5 @@ -You have a new invoice html +<%= t('you_have_a_new_invoice') %> +

+<%= t('sincerely') %>,
+<%= Setting.eis_invoice_contact %>
+<%= @invoice.seller_phone %> diff --git a/app/views/invoice_mailer/invoice_email.text.erb b/app/views/invoice_mailer/invoice_email.text.erb index 7259a751e..2cf1d1197 100644 --- a/app/views/invoice_mailer/invoice_email.text.erb +++ b/app/views/invoice_mailer/invoice_email.text.erb @@ -1 +1,5 @@ -You have a new invoice text +<%= t('you_have_a_new_invoice') %> + +<%= t('sincerely') %>, +<%= Setting.eis_invoice_contact %> +<%= @invoice.seller_phone %> diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb index 6fd450f49..fbab68ab7 100644 --- a/app/views/layouts/mailer.html.erb +++ b/app/views/layouts/mailer.html.erb @@ -4,7 +4,6 @@ -

EIS

<%= yield %> diff --git a/app/views/layouts/mailer.text.erb b/app/views/layouts/mailer.text.erb index e680eea64..37f0bddbd 100644 --- a/app/views/layouts/mailer.text.erb +++ b/app/views/layouts/mailer.text.erb @@ -1,2 +1 @@ -this is email text layout <%= yield %> diff --git a/config/locales/en.yml b/config/locales/en.yml index f1c0c4415..dc013d9d3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -729,3 +729,5 @@ en: invoice_forwared: 'Invoice forwarded' failed_to_forward_invoice: 'Failed to forward invoice' client: 'Client' + you_have_a_new_invoice: 'You have a new invoice.' + sincerely: 'Sincerely'