diff --git a/core/lib/Thelia/Model/Message.php b/core/lib/Thelia/Model/Message.php index 168136f3c..b96887d07 100644 --- a/core/lib/Thelia/Model/Message.php +++ b/core/lib/Thelia/Model/Message.php @@ -2,6 +2,7 @@ namespace Thelia\Model; +use Thelia\Core\Template\Exception\ResourceNotFoundException; use Thelia\Model\Base\Message as BaseMessage; use Propel\Runtime\Connection\ConnectionInterface; use Thelia\Core\Event\TheliaEvents; @@ -74,13 +75,13 @@ class Message extends BaseMessage { $body = false; - $mail_template_path = TemplateHelper::getInstance()->getActiveMailTemplate()->getAbsolutePath() . DS; + //$mail_template_path = TemplateHelper::getInstance()->getActiveMailTemplate()->getAbsolutePath() . DS; // Try to get the body from template file, if a file is defined if (! empty($template)) { try { - $body = $parser->render($mail_template_path . $template); + $body = $parser->render($template); } catch (ResourceNotFoundException $ex) { // Ignore this. } @@ -98,7 +99,7 @@ class Message extends BaseMessage $parser->assign('message_body', $body); // Render the layout file - $body = $parser->render($mail_template_path . $layout); + $body = $parser->render($layout); } return $body; @@ -136,6 +137,7 @@ class Message extends BaseMessage */ public function buildMessage($parser, \Swift_Message $messageInstance) { + $parser->setTemplateDefinition(TemplateHelper::getInstance()->getActiveMailTemplate()); $subject = $parser->fetch(sprintf("string:%s", $this->getSubject())); $htmlMessage = $this->getHtmlMessageBody($parser); $textMessage = $this->getTextMessageBody($parser); diff --git a/templates/email/default/assets/img/header.jpg b/templates/email/default/assets/img/header.jpg new file mode 100644 index 000000000..c80e16529 Binary files /dev/null and b/templates/email/default/assets/img/header.jpg differ diff --git a/templates/email/default/assets/img/logo.gif b/templates/email/default/assets/img/logo.gif new file mode 100644 index 000000000..cfa396641 Binary files /dev/null and b/templates/email/default/assets/img/logo.gif differ diff --git a/templates/email/default/email-layout.tpl b/templates/email/default/email-layout.tpl new file mode 100644 index 000000000..b5aa46cbe --- /dev/null +++ b/templates/email/default/email-layout.tpl @@ -0,0 +1,465 @@ +{declare_assets directory='assets'} +{assign var="url_site" value="{config key="url_site"}"} +{assign var="company_name" value="{config key="store_name"}"} +{if not $company_name} + {assign var="company_name" value="{intl l='Thelia V2'}"} +{/if} + + + + + +{block name="email-subject"}{/block} + + + +
+ + + + +
+ + + + + + + + + + + + + +
+ + + + +
+ + + + + + +
+ {block name="email-intro"}{/block} + + {block name="browser"}{intl l="Email not displaying correctly?"}
{intl l="View it in your browser"}.{/block} +
+
+
+ + + + +
+ + + + +
+ {images file='assets/img/logo.gif'}{$company_name}{/images} +
+
+
+ + + + +
+ + + + + + + +
+ + + + +
+ {block name="email-title"}{/block} +
+
+ + + + + + + +
+ {images file='assets/img/header.jpg'}{/images} +
+ {block name="email-content"}{/block} +
+
+
+
+ + + + +
+ + + + + + + +
+ Follow on Twitter   Friend on Facebook  +
+ {intl l="Our mailing address is:"} +
+ Street name of my business 75000 City, France +
+
+ {intl l="Copyright"} © {'Y'|date} {$company_name}, {intl l="All rights reserved."} +
+
+
+
+
+ + \ No newline at end of file diff --git a/templates/email/default/sample_order_confirmation.html b/templates/email/default/sample_order_confirmation.html index cbc034c42..c4169c4bc 100644 --- a/templates/email/default/sample_order_confirmation.html +++ b/templates/email/default/sample_order_confirmation.html @@ -1,107 +1,121 @@ -{loop name="order.invoice" type="order" id=$order_id customer="*"} - {loop name="currency.order" type="currency" id=$CURRENCY} - {assign "orderCurrency" $SYMBOL} - {/loop} -{loop type="customer" name="customer.invoice" id=$CUSTOMER current="0"} - {assign var="customer_ref" value=$REF} -{/loop} - - - - - {intl l="Courriel de confirmation de commande de %uil" url={config key="url_site"}} - {literal} - - {/literal} - - -
-

{config key="company_name"}

-

{intl l="Confirmation de commande"}

-

N° {$REF} du {format_date date=$INVOICE_DATE output="date"}

-
- - - - - - - - - {loop type="order_product" name="order-products" order=$ID} - {if $WAS_IN_PROMO == 1} - {assign "realPrice" $PROMO_PRICE} - {assign "realTax" $PROMO_PRICE_TAX} - {assign "realTaxedPrice" $TAXED_PROMO_PRICE} - {else} - {assign "realPrice" $PRICE} - {assign "realTax" $PRICE_TAX} - {assign "realTaxedPrice" $TAXED_PRICE} - {/if} - - - - - - +{extends file="email-layout.tpl"} + +{* Open in browser *} +{block name="browser"}{/block} + +{* Subject *} +{block name="email-subject"}Your order confirmation Nº {$order_ref}{/block} + +{* Title *} +{block name="email-title"}Thank you for your order!{/block} + +{* Content *} +{block name="email-content"} + + {loop name="order.invoice" type="order" id=$order_id customer="*"} + {loop name="currency.order" type="currency" id=$CURRENCY} + {assign "orderCurrencySymbol" $SYMBOL} + {assign var="orderCurrencyIsoCode" value=$ISOCODE} + {/loop} + {loop type="customer" name="customer.invoice" id=$CUSTOMER current="0"} + {assign var="customerRef" value=$REF} {/loop} - - - - - - - - - - - - - - - - - -
{intl l="Référence"}{intl l="Désignation"}{intl l="P.U. %currency" currency=$orderCurrency}{intl l="Qté"}
{$REF}{$TITLE} - {ifloop rel="combinations"} - {loop type="order_product_attribute_combination" name="combinations" order_product=$ID} - {$ATTRIBUTE_TITLE} - {$ATTRIBUTE_AVAILABILITY_TITLE}
- {/loop} - {/ifloop} -
{$orderCurrency} {$realTaxedPrice}{$QUANTITY}
 
{intl l="Montant total avant remise %currency" currency=$orderCurrency}{$orderCurrency} {$TOTAL_TAXED_AMOUNT - $POSTAGE}
Port €{$orderCurrency} {$POSTAGE}
{intl l="Montant total de la commande%currency" currency=$orderCurrency}{$orderCurrency} {$TOTAL_TAXED_AMOUNT}
-
-

{loop name="delivery-module" type="module" id=$DELIVERY_MODULE}{intl l="LIVRAISON : %module" module=$TITLE}{/loop}

- {loop type="order_address" name="delivery_address" id=$INVOICE_ADDRESS} -

{intl l="N° de client : %ref" ref=$customer_ref}

-

{intl l="Nom :"} - {loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop} {$FIRSTNAME} {$LASTNAME}

-

{intl l="N° et rue :"} - {$ADDRESS1}

-

{intl l="Complément : "}{$ADDRESS2} - {$ADDRESS3}

-

{intl l="Code postal : %zip" zip=$ZIPCODE}

-

{intl l="Ville : %city" city=$CITY}

-

{loop type="country" name="country_delivery" id=$COUNTRY}{intl l="Pays : %name" name=$TITLE}{/loop}

-
+ + Here are the details of your purchase:

+ + + + + + +
+ Delivery address:
+ {loop type="order_address" name="delivery_address" id=$DELIVERY_ADDRESS} + {$FIRSTNAME} {$LASTNAME}
+ {$ADDRESS1}
+ {if $ADDRESS2 != ""}{$ADDRESS2}
{/if} + {if $ADDRESS3 != ""}{$ADDRESS3}
{/if} + {$CITY}
+ {$ZIPCODE}, {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}
+ {/loop} +
+ Billing address:
+ {loop type="order_address" name="invoice_address" id=$INVOICE_ADDRESS} + {$FIRSTNAME} {$LASTNAME}
+ {$ADDRESS1}
+ {if $ADDRESS2 != ""}{$ADDRESS2}
{/if} + {if $ADDRESS3 != ""}{$ADDRESS3}
{/if} + {$CITY}
+ {$ZIPCODE}, {loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}
+ {/loop} +
+ +
+ +

+ Order Total: {$TOTAL_TAXED_AMOUNT} {$orderCurrencySymbol} {$orderCurrencyIsoCode}
+ Order Number: {$REF}
+ Paid With: {loop name="payment-module" type="module" id=$PAYMENT_MODULE}{$TITLE}{/loop}
+ Purchase Date: {format_date date=$CREATE_DATE output="date"}
+ Delivery method: {loop name="delivery-module" type="module" id=$DELIVERY_MODULE}{$TITLE}{/loop}
+

+ + + + + + + {loop type="order_product" name="order-products" order=$ID} + {if $WAS_IN_PROMO == 1} + {assign "realPrice" $PROMO_PRICE} + {assign "realTax" $PROMO_PRICE_TAX} + {assign "realTaxedPrice" $TAXED_PROMO_PRICE} + {else} + {assign "realPrice" $PRICE} + {assign "realTax" $PRICE_TAX} + {assign "realTaxedPrice" $TAXED_PRICE} + {/if} + + + + + {/loop} + + + + + + + + + + + + +
What You PurchasedPrice in {$orderCurrencyIsoCode}
+ {$TITLE} ({$REF}) + {ifloop rel="combinations"}
+ {loop type="order_product_attribute_combination" name="combinations" order_product=$ID} + * {$ATTRIBUTE_TITLE}: {$ATTRIBUTE_AVAILABILITY_TITLE} + {/loop} + {/ifloop} +
+ {$QUANTITY} x {$realTaxedPrice} {$orderCurrencySymbol} +
Total{$TOTAL_TAXED_AMOUNT - $POSTAGE} {$orderCurrencySymbol}
Shipping:{$POSTAGE} {$orderCurrencySymbol}
Order Total{$TOTAL_TAXED_AMOUNT} {$orderCurrencySymbol}
{/loop} -
-

{loop name="payment-module" type="module" id=$PAYMENT_MODULE}{intl l="FACTURATION : paiement par %module" module=$TITLE}{/loop}

- {loop type="order_address" name="delivery_address" id=$DELIVERY_ADDRESS} -

N° de client : {$customer_ref}

-

Nom : - {loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop} {$FIRSTNAME} {$LASTNAME}

-

{intl l="N° et rue :"} - {$ADDRESS1}

-

{intl l="Complément : "}{$ADDRESS2} - {$ADDRESS3}

-

{intl l="Code postal : %zip" zip=$ZIPCODE}

-

{intl l="Ville : %city" city=$CITY}

-

{loop type="country" name="country_delivery" id=$COUNTRY}{intl l="Pays : %name" name=$TITLE}{/loop}

-
- {/loop} -

{intl l="Le suivi de votre commande est disponible dans la rubrique mon compte sur %url" url={config key="url_site"}}

-
- - -{/loop} \ No newline at end of file + +
+ +

Support

+ For any questions, or concerns, feel free to contact support@yourdomain.com.

+ Our contact us at:
+ Thelia V2
+ Street name of my business
+ City
+ 75000, France + +
+
+ Thanks,
+ The Thelia V2 team +{/block}