-1

Please how do I change the order and shipment mailer notification to show the users Name in the salutation instead of 'Dear Customer'

2 Answers2

2

Or you could use string interpolation in this case:

<%= "Dear #{@username}" %>

String concatenation vs. interpolation in Ruby

Community
  • 1
  • 1
Long Tran
  • 83
  • 1
  • 8
0

Do this way

<%= "Dear " + @username %>
Rajdeep Singh
  • 17,621
  • 6
  • 53
  • 78
  • 1
    Thanks for the prompt response. I'll try this out when I get to my computer and mark as Answer. Thanks.. – user1823354 Nov 18 '14 at 07:42
  • Hi, so I've added this to my mailer view but it still shows Dear Customer. Is there something else I should do for the change to effect? – user1823354 Nov 18 '14 at 09:23
  • <%= Spree.t('shipment_mailer.shipped_email.dear_customer') %> -- That is the part with the salutation. i've replaced with <%='Dear ' + @user.first_name %> but Its still shows "Dear Customer" – user1823354 Nov 18 '14 at 11:07
  • `unterminated string meets end of file` -- i'm getting this error – user1823354 Nov 18 '14 at 12:29