Skip to Content
Node与Express开发(第2版)
book

Node与Express开发(第2版)

by Ethan Brown
June 2021
Intermediate to advanced
290 pages
9h 21m
Chinese
Posts & Telecom Press
Content preview from Node与Express开发(第2版)
发送邮件
|
111
text: 'Thank you for booking your trip with Meadowlark Travel. ' +
'We look forward to your visit!',
})
同时提供
HTML
和纯文本工作量太大了,尤其是当只有少数用户选择纯文本邮件时,同
时提供两种形式似乎有些多余。如果你想节省一些时间,可以只写
HTML
,然后使用像
html-to-formatted-text
这样的包从
HTML
自动生成文本
。(不过要记住,
HTML
转换的文本
质量跟手写出来的比不了,不会像手写那样整齐、清晰。)
11.8.1
 
HTML
邮件中的图片
虽然可以在
HTML
邮件中嵌入图片数据,但是我非常不赞成这么做。它们会使邮件变得臃
肿,通常不认为这是一种好做法。你应该把邮件中要使用的图片放到你的
We
b
服务器上,
然后在邮件中适当地链接到这些图片。
在静态资源目录下,最好为邮件的图片创建专用的目录。你也应该单独存放那些同时用于
网站和邮件的资源,这样便可以降低对邮件布局造成不利影响的可能性。
让我们在草地鹨旅游项目中增加一些邮件的资源。在
public
目录下创建子目录
emai
。你可
以把
logo.png
放进去
,也可以把其他想用于邮件的图片放进去。然后,就可以直接在邮件
里使用那些图片了:
<img src="//meadowlarktravel.com/email/logo.png"
alt="Meadowlark Travel Logo">
在给其他人发邮件时,你显然不会再使用 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

面向对象的思考过程(原书第5版)

面向对象的思考过程(原书第5版)

马特 魏斯费尔德
精通模块化JavaScript

精通模块化JavaScript

Nicolás Bevacqua

Publisher Resources

ISBN: 9787115565099