-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathemail.html
135 lines (103 loc) · 6.51 KB
/
email.html
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
{%- set entry = object -%}
{%- set form = entry.getForm() -%}
<!doctype html>
<html>
<head>
<title>{{ siteName }}</title>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" offset="0">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<table>
<tr>
<td valign="top" style="width:600px;">
{% if email.defaultBody|length %}
<table>
<tr>
<td valign="top" style="width:600px;">
<p>{{ email.defaultBody|nl2br }}</p>
</td>
</tr>
</table>
{% endif %}
<table>
<tr>
<td style="border-top:1px solid #eee;border-bottom:1px solid #eee;background-color:#fefefe;width:600px;">
{% set tabs = entry.getFieldLayout().getTabs() %}
{% for tab in tabs %}
<table>
<tr>
<td>
<p><em>{{ "Form submission received from:"|t('sprout-forms') }} {{ siteName }}</em></p>
<p><span style="text-transform: uppercase;"><strong>{{ form.name }}</strong></span></p>
{% set fields = tab.getFields() %}
{% for field in fields %}
{% set value = attribute(entry, field.handle) %}
{% if loop.first and tabs|length > 1 %}
<p>
<strong>{{ tab.name }}</strong>
</p>
{% endif %}
<p>
<strong>{{ field.name }}</strong>
<br/>
{% if field.getFieldInputFolder() == 'table' %}
{% set cols = null %}
{% if field.cols | length %}
{% set cols = field.cols %}
{% endif %}
<table width="100%" cellspacing="0" cellpadding="12" border="0">
<thead>
<tr>
{% for col in cols %}
<th align="left" style="border-bottom: 2px solid #dee2e6; border-top: 1px solid #dee2e6;">{{ col.label }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for row in value %}
<tr>
{% for col in row %}
<td style="border-top: 1px solid #dee2e6;">{{ col }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% elseif value is not iterable and value is not empty %}
{{ value|nl2br }}
{% elseif value is iterable %}
<ul style="margin-left:0;padding-left:10px;">
{% for item in value %}
{% if item is not empty %}
<li>{{ item }}</li>
{% endif %}
{% endfor %}
</ul>
{% else %}
<em>{{ "No response"|t('sprout-forms') }}</em>
{% endif %}
</p>
{% endfor %}
</td>
</tr>
<tr>
<td {% if not loop.last %}style="border-top:1px solid #eee;background-color:#fefefe;
width:600px;"{% endif %}>
</td>
</tr>
</table>
{% endfor %}
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- END TEMPLATE CONTAINER -->
</td>
</tr>
</table>
</body>
</html>