email-templates

Get Product Name and Description in WooCommerce email templates

旧街凉风 提交于 2019-12-05 11:09:17
I am trying to get product descripton and the product name when email is sent in WooCommerce email templates. I am able to get product id $order_id = trim(str_replace('#', '', $order->get_items())); using this code But when I am trying to get its description and product name I am not able to do the same. My code: $order = new WC_Order($order_id); foreach($order->get_items() as $item){ $product_description = get_post($item['product_id'])->post_content; } How can I make it work? Thanks I added this in function.php what i ma trying to do is after the order is set completed i am trying to send sms

Use Razor views as email templates inside a Web Forms app

偶尔善良 提交于 2019-12-05 06:54:45
问题 I have an asp.net Web Forms application that needs to send emails. I like the Razor syntax and as you can use Razor outside of MVC I thought I'd try and use that. I've seen that you can programmatically pass a template string to razor but I'd like to keep my razor templates as separate .cshtml files. Does anyone have any simple, idiot-proof advice as to how to do this? I've tried to load them from file like this: UserDetails userDetails = new UserDetails {Name = "Fred"}; string template =

What is the best way to use Email Template in Zend/PHP

匆匆过客 提交于 2019-12-05 02:04:54
问题 I am working on a website where Users create their accounts. I need to send email to users on many oceans. For example when signup, forgot password, order summary etc. I want to use emails templates for this. I need your suggestions for this. I want to use a way that If I change any email template or login in less time and changes. I have thought about the following way: I have a table for email templates like this: id emailSubject emailBody emailType For example when user forgot password: id

Building HTML emails, can I put styles in the header section or do I have to use inline styles?

偶尔善良 提交于 2019-12-04 21:27:52
I have to build some email templates using basic HTML and CSS. I have found this page which details which CSS styles are most supported in various email clients. I understand these will work as inline styles. However I'd like to put them in the head section of the email as it will be a bit cleaner, can I do that as well and will it be well supported? E.g. <!DOCTYPE html> <html> <head> <style type="text/css"> /* CSS goes here */ </style> </head> <body> Email goes here </body> </html> Many thanks! Using CSS and HTML in Email Newsletters a post in http://groundwire.org will help you.. http:/

pass custom variable/parameter from email template to phtml file

笑着哭i 提交于 2019-12-04 12:47:54
I am stuck in my custom code. I want to pass a custom variable from email template to pthml file. Edit file app/code/local/Mage/Sales/Model/Order.php in this function : public function sendNewOrderEmail() { --- default code start ---- $mailer->setTemplateParams(array( 'order' => $this, 'test' => 'XXXXX', 'billing' => $this->getBillingAddress(), 'payment_html' => $paymentBlockHtml ) ); --- default code end ---- } and then I put this code in New Order email template: {{layout handle="sales_email_order_items" order=$order test=$test}} template file located here : app/locale/en_US/template/email

Use Razor views as email templates inside a Web Forms app

喜你入骨 提交于 2019-12-03 22:20:08
I have an asp.net Web Forms application that needs to send emails. I like the Razor syntax and as you can use Razor outside of MVC I thought I'd try and use that. I've seen that you can programmatically pass a template string to razor but I'd like to keep my razor templates as separate .cshtml files. Does anyone have any simple, idiot-proof advice as to how to do this? I've tried to load them from file like this: UserDetails userDetails = new UserDetails {Name = "Fred"}; string template = File.OpenText("Email/UserDetailsEmail.cshtml").ReadToEnd(); string messageText = Razor.Parse(template,

Issue in creating email teamplate

╄→гoц情女王★ 提交于 2019-12-02 17:59:30
问题 I am trying to create an email template like following. I have used table. I am able to do everything except the image is not displayed at proper position. The images should be displayed in middle and on top of the container(see screen 1), but I am not able accomplished it. I have tried to provide negative margin to container , but gmail and other mail services are ignoring the negative margin. Here's what I was able to accomplishd till so far. The code is present here. Can anyone please help

Issue in creating email teamplate

浪子不回头ぞ 提交于 2019-12-02 09:26:37
I am trying to create an email template like following. I have used table. I am able to do everything except the image is not displayed at proper position. The images should be displayed in middle and on top of the container(see screen 1), but I am not able accomplished it. I have tried to provide negative margin to container , but gmail and other mail services are ignoring the negative margin. Here's what I was able to accomplishd till so far. The code is present here . Can anyone please help with this? As I said: If it was me i would make the top border and the image a row. – Alex Thomas 23

Media query in responsive email template

混江龙づ霸主 提交于 2019-12-01 18:43:16
问题 I need to build a responsive email template. I did my research and learnt that media queries are not widely supported by the email clients. So, I tried not to use media query and stacked the columns using display: inline-block; max-width:290px; . But what if I want to change the font size for mobile version? Also I have a case where client wants few blocks to be visible in mobile but not on desktop. How can I achieve these without media query? Also, in my case when I add style rules and media

Media query in responsive email template

别来无恙 提交于 2019-12-01 18:21:08
I need to build a responsive email template. I did my research and learnt that media queries are not widely supported by the email clients. So, I tried not to use media query and stacked the columns using display: inline-block; max-width:290px; . But what if I want to change the font size for mobile version? Also I have a case where client wants few blocks to be visible in mobile but not on desktop. How can I achieve these without media query? Also, in my case when I add style rules and media queries, I guess iOS supports media queries. But rues under media queries are not appearing but the