<{* Template: invoice.html Description: Email send immediatly after an order has been made. Author: 1260 A/S, @1260-digital Since: 2022-09-01 *}> <{* --------------- Currencies --------------- *}> <{if $settings.general.thousand == 'point'}> <{capture name='thousand'}>.<{/capture}> <{elseif $settings.general.thousand == 'comma'}> <{capture name='thousand'}>,<{/capture}> <{else}> <{capture name='thousand'}> <{/capture}> <{/if}> <{if $settings.general.decimal == 'point'}> <{capture name='decimal'}>.<{/capture}> <{elseif $settings.general.decimal == 'comma'}> <{capture name='decimal'}>,<{/capture}> <{else}> <{capture name='decimal'}> <{/capture}> <{/if}> <{if $settings.currency.display}> <{assign var="currency" value=$settings.currency.display}> <{else}> <{assign var="currency" value="kr."}> <{/if}> <{* html blocks *}> <{capture name="order_details"}> <{include file="mails/email.order.details.html"}> <{/capture}> <{capture name="order_terms"}> <{include file="mails/email.order.terms.html"}> <{/capture}> <{capture name="order_products"}> <{include file="mails/email.order.products.html" is_order=true products=$order->getOrderProducts()}> <{/capture}> <{* variables *}> <{assign var="company_name" value=$settings.company.name}> <{assign var="company_phone" value=$settings.company.phone}> <{assign var="company_email" value=$settings.company.email}> <{assign var="customer_name" value=$order->getOrderName()|escape}> <{assign var="order_id" value=$order->getWebshopOrderId()}> <{assign var="order_url" value=$order->getUrl()}> <{assign var="order_details" value=$smarty.capture.order_details}> <{assign var="order_terms" value=$smarty.capture.order_terms}> <{assign var="products_list" value=$smarty.capture.order_products}> <{capture name="email_subject"}> <{t x=$order->getWebshopOrderId()}>Thank you for your purchase with order number {x}!<{/t}> <{/capture}> <{capture name="payment_html"}> <{if !$order->getIsPaid()}> <{assign var="gateways" value=$webshop->getPaymentGateways()}> <{section name="i" loop=$gateways}> <{if $order->getPaymentGatewayId() == $gateways[i]->getPaymentGatewayId()}> <{assign var="payment_html_field" value=$gateways[i]->getHtmlField('payment_info')}> <{if $payment_html_field }>
<{$payment_html_field}>
<{/if}> <{/if}> <{/section}> <{/if}> <{/capture}> <{assign var="payment_info" value=$smarty.capture.payment_html}> <{capture name="email_content"}>

<{t x=$customer_name}>Hi {x}<{/t}>

Thank you for your purchase!

<{$payment_info}> <{$smarty.capture.order_details}> <{$smarty.capture.order_products}>

<{t}>Please get in touch if you have questions, or if we can help in any way.<{/t}>

<{t}>Best regards<{/t}>

<{$company_name}>

<{/capture}> <{assign var="email_subject" value=$settings.emails.invoice_mail_subject|default:$smarty.capture.email_subject}> <{assign var="email_content" value=$settings.emails.invoice_mail_content|default:$smarty.capture.email_content}> <{* find & replace *}> <{assign var="find" value='||'|explode:"[payment_info]||[company_phone]||[company_email]||[customer_name]||[order_url]||[products_list]||[order_details]||[order_terms]||[order_id]"}> <{assign var="repl" value='||'|explode:"$payment_info||$company_phone|| $company_email||$customer_name||$order_url||$products_list||$order_details||$order_terms||$order_id"}> <{* view *}> <{if $subject}> <{$email_subject|replace:$find:$repl}> <{else}> <{include file="mails/email.wrapper.start.html"}> <{$email_content|replace:$find:$repl}> <{include file="mails/email.wrapper.end.html"}> <{/if}>