forked from saberma/shopqi
/
edit.html.haml
61 lines (60 loc) · 2.61 KB
/
edit.html.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
-use_javascripts 'controllers/emails'
%h2#title==编辑#{KeyValues::Mail::Type.find_by_code(email.mail_type).name}模板
#action-links
%ul
=render partial:"shared/noscript"
=render partial:"shared/upgrade_ie"
#action-links{:style => "margin-bottom: 10px"}
%ul
%li.no-icon
%a{:href => "/admin/notifications"}=w('back')
%br/
%h3==#{KeyValues::Mail::Type.find_by_code(email.mail_type).name}模板
%p=KeyValues::Mail::Type.find_by_code(email.mail_type).des
.form-group
.form-group-content
%h3 纯文本模板
%p
在下面的模板中,只允许使用纯文本格式,
= succeed "." do
%a{:href => "http://wiki.shopify.com/Email_Variable_Reference", :target => "wiki", :title => "Open Wiki in a new window"} 可用于邮件模板中的参数
=form_for email do |f|
%dl
%dt=f.label :title
%dd=f.text_field :title,class:"big"
%dt=f.label :body
%dd
%ul#status-log.nobull.field-with-errors{:style => "display:none; margin: 3px 3px 10px 3px;"}
%li#status-message
%li#status-errorlist{:style => "font-weight: bold"}
=f.text_area :body,rows:30,cols:90,class:'compile-ok',id:'source'
-#
.preview
%a{:href => "#", :onclick => "previewEmailTemplate(); return false;"} Preview plain text email
%h3 启用HTML模板
%p
HTML 邮件模板给你提供更多的格式选择,但是,你需要了解HTML的一些知识。您可以选择通过哪一种方式来渲染邮件。
%br/
=f.check_box :include_html
%label{:for => "email_include_html"} 使用HTML 模板
#html_form{:style => "display:none"}
%dl
%dt
%label{:for => "email_body"} 修改您的HTML邮件模板
%dd
%ul#status-log.nobull.field-with-errors{:style => "display:none; margin: 3px 3px 10px 3px;"}
%li#status-message
%li#status-errorlist{:style => "font-weight: bold"}
%textarea#source.compile-ok{:cols => "90", :name => "email[body_html]", :rows => "30"}
-#
.preview
%a{:href => "#", :onclick => "previewHtmlEmailTemplate(); return false;"} Preview HTML email
%p.btns
=f.submit w('save'),class: 'btn'
=w('or')
%a{:href => "/admin/notifications"}=w('back')
-#
or
%a{:href => "#", :onclick => "new Ajax.Request('/admin/notifications/deliver_copy', { parameters: $H(Form.serialize('edit-form', true)).merge({_method: 'post'}) }); return false;"} Send test email to liwh87@gmail.com
:javascript
new App.Controllers.Emails()