Documentation / @zerotal/notifications / RichLine
Class: RichLine
Defined in: notifications/src/messages/MailMessage.ts:56
Fluent builder for a single line composed of differently-styled runs of text.
Passed to the callback form of MailMessage.line().
Example
.line((t) => t
.text("Your order ")
.bold("#1234")
.text(" is ")
.color("on its way", "#16a34a"))
Constructors
Constructor
new RichLine():
RichLine
Returns
RichLine
Methods
text()
text(
content):this
Defined in: notifications/src/messages/MailMessage.ts:61
Append an unstyled run.
Parameters
content
string
Returns
this
bold()
bold(
content):this
Defined in: notifications/src/messages/MailMessage.ts:67
Append a bold run.
Parameters
content
string
Returns
this
italic()
italic(
content):this
Defined in: notifications/src/messages/MailMessage.ts:73
Append an italic run.
Parameters
content
string
Returns
this
color()
color(
content,color):this
Defined in: notifications/src/messages/MailMessage.ts:79
Append a coloured run. color is any CSS color.
Parameters
content
string
color
string
Returns
this
size()
size(
content,px):this
Defined in: notifications/src/messages/MailMessage.ts:85
Append a run with an explicit font size in pixels.
Parameters
content
string
px
number
Returns
this
styled()
styled(
content,style):this
Defined in: notifications/src/messages/MailMessage.ts:91
Append a run with an arbitrary combination of styles.
Parameters
content
string
style
Returns
this