email-templates

How to position an element on top of another element without using position and margin?

烂漫一生 提交于 2019-12-13 01:16:22
问题 This is my code: <table>...Some content...</table> <table>...Another content...</table> I want to put the second table on top of the first table. This is to be used as an email template (in some clients position and margin are not available). 回答1: Those are the only two options available (outside of transform , which definitely won't work if position isn't available) that will allow one element to invade another element's space. If you can't use position or margin , then you're out of luck,

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

对着背影说爱祢 提交于 2019-12-12 09:27:38
问题 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

Stretch/Fit HTML Template and Children to Window

落花浮王杯 提交于 2019-12-12 02:58:54
问题 My application generates HTML email templates. They are between 600px and 650px wide usually, but sometimes they go up to 900px. The templates are nested pretty deep (lots of table elements for email clients), and sadly all the widths/heights are hard-coded in px, not relative dimensions. This has been ok until now, because my users view them in a browser. But now I am building a mobile app. I am trying to display these templates in a webview inside various mobile clients (iPhone, Android,

Is there an easier way to write text email templates in Python?

ぃ、小莉子 提交于 2019-12-11 15:18:00
问题 I must be totally missing something here. What follows is as far as I could take it ( jinja with trim_blocks , not Django templates): {%- if order.contact_name -%} Name: {{ order.contact_name + '\n' -}} {%- endif -%} Phone: {{ order.phone + '\n' -}} {%- if order.email -%} Email: {{ order.email + '\n' -}} {%- endif -%} {%- if order.comment -%} Comment: {{ order.comment + '\n' -}} {%- endif -%} {%- if order.delivery_type or order.town or order.branch or order.address -%} {{- '\n' -}} {%- if

Helper methods available in mailer views depend on environment?

[亡魂溺海] 提交于 2019-12-11 07:37:12
问题 Related to my previous question I still have one thing that I would like to understand - why this: = link_to(root_path) = link_to(@some_path_set_in_mailer) works in development mode (config.action_mailer.perform_deliveries was set to true and emails were actually sent) and in production or staging has to be changed to: = link_to(@some_path_set_in_mailer, @some_path_set_in_mailer) to avoid "No route matches {}" error? I had this problem in rails 3.2. 回答1: I'm not entirely sure why there is a

rails 3.2 haml email template link_to error

社会主义新天地 提交于 2019-12-11 07:36:49
问题 I have an application (rails 3.2) with haml (3.1.4) emails. In the email template I wanted to use link_to, but apparently none of those 4 is working in production: #{link_to(my_models_url)} = link_to(my_models_url) / @url set to my_models_url #{link_to(@url)} = link_to(@url) On development mode everything works fine, but in production, I keep getting the following error: No route matches {} actionpack (3.2.0) lib/action_dispatch/routing/route_set.rb:503:in `raise_routing_error' It works when

Do HTML email templates require the use of the style attribute?

此生再无相见时 提交于 2019-12-11 03:32:25
问题 Are there scenarios where it is (for some reason) required to place the CSS rule inside the style attribute of the HTML tag directly instead of placing the CSS rule inside a selector in the STYLE element in the HEAD of the HTML email template? (I am asking for the most common CSS selectors, like type, class, ID, descendant combinations) Follow-up question: Gmail seems to be the only relevant email service that does not support the STYLE element. Why is that? (What's the reasoning behind this

How to place a link to a view in the email template of odoo

送分小仙女□ 提交于 2019-12-10 22:45:29
问题 In my custom room booking application, when user book a room a mail will send to the admin. In the mail template, there is an approve button. Once the admin clicks the approve button, it should redirect to the approval form view. How can I do that by placing a link in the email template? 回答1: The url you have to compose is of the following form: http://odoo.server.com/web?db=#id=&view_type=form&model= 回答2: You can put in your template a text ${ctx['url']} and then render send template with

Loading a Magento mail template and fill its vars from code?

徘徊边缘 提交于 2019-12-06 05:04:34
问题 I am loading my mail template like this: $mailTemplate = Mage::getModel('core/email_template'); $myTemplate = $mailTemplate->load($templateId); Now I can get the template content using: $text = $myTemplate ->getData('template_text'); This works, but $text still contains the placeholders for the variables, like {{var myvar}} or {{store url=""}}. Is there a way to fill those placeholders when loading the template without sending the mail? I want to show the text to the user, but with filled

pass custom variable/parameter from email template to phtml file

会有一股神秘感。 提交于 2019-12-06 04:56:09
问题 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