Deface Email text

56 views
Skip to first unread message

Sofy Basir

unread,
Jan 15, 2014, 7:41:07 PM1/15/14
to spree...@googlegroups.com
Hi,

I was attempting to deface the email views but was unsuccessful due the deface not being able to read "text" files:

Deface::DSL does not know how to read '/store/app/overrides/spree/order_mailer/confirm_email.text/append_text.text.erb.deface'. Override files should end with just .deface, .html.erb.deface, .html.haml.deface or .html.slim.deface

The deface:

<!-- insert_after "erb:contains('order_mailer.confirm_email.thanks')" -->
    My text I want to insert

Is there a way to do this with deface that I'm not familiar with? Or is it intentional that we should override the views completely?

Interestingly deface can find the selector:

$ bundle exec rake deface:test_selector['spree/order_mailer/confirm_email.text',"erb:contains('order_mailer.confirm_email.thanks')"]


   
Querying 'spree/order_mailer/confirm_email.text' for 'erb:contains('order_mailer.confirm_email.thanks')'
   
---------------- Match 1 ----------------
   
<%= Spree.t('order_mailer.confirm_email.thanks') %>

Cheers

Peter Berkenbosch

unread,
Jan 16, 2014, 3:55:51 AM1/16/14
to spree...@googlegroups.com
Hi Sofy,

Deface needs structured data to parse the view, since it’s relying on nokogiri for the xpath expressions. So text files are not supported. 

The email views needs are mostly very custom, so best approach here is to override them completely.

I do find it interesting that the selector search did work though.

--
Peter Berkenbosch
Developer
Spree Commerce Inc

Spree Commerce

@spreecommerce GitHub Open Source Facebook Google+

Join us in New York City for SpreeConf 2014 February
 26th and 27th.   Learn more
use SpreeConf_PB for 33% discount!

SpreeConf NY 2014

--
Don't miss SpreeConf on Feb 26-27
http://spreeconf.com

Sofy Basir

unread,
Jan 16, 2014, 4:01:34 AM1/16/14
to spree...@googlegroups.com
That makes sense. Good to know the reason!

Thanks
Reply all
Reply to author
Forward
0 new messages