How to format a table of data in an email template? #1733
-
Hi I have a table of data on my form eg: When I get an email notification, all fields are output in one line:
Not surprising as my email template is very basic: {% extends "mail/_confirm.twig" %}
{% set name = name ?? firstName ?? null %}
{% block content %}
<h2 style="line-height:1.25">Hi {{ name }}, thank you for submitting our {{ form.name }} form.</h2>
<ul>
{% for field in allFields %}
<li>
{{ field.label }}:
{{ field.valueAsString }}
</li>
{% endfor %}
</ul>
{% endblock %} But I can't find any documentation on how to handle tables of data differently. Can you point me to a web page that describes how to format tables in the email notificaiton emplates? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @wolispace You will want to check out the "Email Notification Template" guide for the Table field here: https://docs.solspace.com/craft/freeform/v5/forms/fields/#table 🙂 |
Beta Was this translation helpful? Give feedback.
-
Works a treat. Don't know why I couldn't see this before. |
Beta Was this translation helpful? Give feedback.
Hi @wolispace
You will want to check out the "Email Notification Template" guide for the Table field here:
https://docs.solspace.com/craft/freeform/v5/forms/fields/#table
🙂