Skip to content

Commit

Permalink
Add products to the email
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed Sep 20, 2022
1 parent df5b091 commit d71a315
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Resources/translations/messages.da.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ setono_sylius_abandoned_cart:
Vi har gemt din indkøbskurv for dig, så du kan fortsætte dit indkøb. Klik blot på knappen herunder.
continue_shopping: Fortsæt dit indkøb
unsubscribe: Afmeld
cart_contents: Du havde følgende exceptionelle og velvalgte varer i kurven, da der var noget, der afbrød dit indkøb. Lad være med at forlad disse varer!
form:
unsubscribed_customer:
email: Email
Expand Down
1 change: 1 addition & 0 deletions src/Resources/translations/messages.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ setono_sylius_abandoned_cart:
We saved your cart for you, so you can continue your shopping - just click the button below.
continue_shopping: Continue shopping
unsubscribe: Unsubscribe
cart_contents: You had the following exceptional, well selected items in your cart when something interrupted your shopping. Don't abandon this!
form:
unsubscribed_customer:
email: Email
Expand Down
22 changes: 21 additions & 1 deletion src/Resources/views/email/notification.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,34 @@
{% block subject %}{{ 'setono_sylius_abandoned_cart.emails.notification.subject'|trans }}{% endblock %}

{% block content %}
{{ 'setono_sylius_abandoned_cart.emails.notification.intro'|trans({ '%customer%': notification.recipientFirstName })|raw }}
<div style="text-align: center; margin-bottom: 30px;">
{{ 'setono_sylius_abandoned_cart.emails.notification.intro'|trans({ '%customer%': notification.recipientFirstName })|raw }}
</div>

<div style="text-align: center; margin-bottom: 30px;">
<a href="{{ urls.cartRecovery }}" style="display: inline-block; text-align: center; background: #1abb9c; padding: 18px 28px; color: #fff; text-decoration: none; border-radius: 3px;">
{{ 'setono_sylius_abandoned_cart.emails.notification.continue_shopping'|trans({}, null, localeCode) }}
</a>
</div>

<div style="text-align: center; margin-bottom: 30px;">
{{ 'setono_sylius_abandoned_cart.emails.notification.cart_contents'|trans({ '%customer%': notification.recipientFirstName })|raw }}
</div>

<table cellpadding="0" cellspacing="0" border="0" width="100%" style=" margin-bottom: 30px;">
<tr>
<th style="text-align: left; padding: 5px 10px">Quantity</th>
<th style="text-align: left; padding: 5px 10px">Product</th>
</tr>
{# @var \Sylius\Component\Core\Model\OrderItemInterface item #}
{% for item in notification.cart.items %}
<tr>
<td style="padding: 5px 10px">{{ item.quantity }}</td>
<td style="padding: 5px 10px">{{ item.productName }}</td>
</tr>
{% endfor %}
</table>

<div style="text-align: center; margin-bottom: 30px;">
<a href="{{ urls.unsubscribe }}">
{{ 'setono_sylius_abandoned_cart.emails.notification.unsubscribe'|trans({}, null, localeCode) }}
Expand Down

0 comments on commit d71a315

Please sign in to comment.