This repository has been archived by the owner on Nov 10, 2017. It is now read-only.
forked from mareknovotny/jboss-seam
-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathMail.xml
executable file
·776 lines (671 loc) · 27.8 KB
/
Mail.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
<chapter id="mail">
<title>Email</title>
<para>
Seam now includes an optional components for templating and sending emails.
</para>
<para>
Email support is provided by <literal>jboss-seam-mail.jar</literal>. This
JAR contains the mail JSF controls, which are used to construct emails,
and the <literal>mailSession</literal> manager component.
</para>
<para>
The examples/mail project contains an example of the email support in
action. It demonstrates proper packaging, and it contains a number of
example that demonstrate the key features currently supported.
</para>
<para>
You can also test your mail's using Seam's integration testing environment.
See <xref linkend="testing.mail" />.
</para>
<section>
<title>Creating a message</title>
<para>
You don't need to learn a whole new templating language to use Seam Mail
— an email is just facelet!
</para>
<programlisting role="XHTML"><![CDATA[<m:message xmlns="http://www.w3.org/1999/xhtml"
xmlns:m="http://jboss.org/schema/seam/mail"
xmlns:h="http://java.sun.com/jsf/html">
<m:from name="Peter" address="[email protected]" />
<m:to name="#{person.firstname} #{person.lastname}">#{person.address}</m:to>
<m:subject>Try out Seam!</m:subject>
<m:body>
<p><h:outputText value="Dear #{person.firstname}" />,</p>
<p>You can try out Seam by visiting
<a href="http://labs.jboss.com/jbossseam">http://labs.jboss.com/jbossseam</a>.</p>
<p>Regards,</p>
<p>Pete</p>
</m:body>
</m:message>]]></programlisting>
<para>
The <literal><m:message></literal> tag wraps the whole message,
and tells Seam to start rendering an email. Inside the <literal><m:message></literal>
tag we use an <literal><m:from></literal> tag to set who the
message is from, a <literal><m:to></literal> tag to specify a
sender (notice how we use EL as we would in a normal facelet), and a
<literal><m:subject></literal> tag.
</para>
<para>
The <literal><m:body></literal> tag wraps the body of the email.
You can use regular HTML tags inside the body as well as JSF components.
</para>
<para>
So, now you have your email template, how do you go about sending it?
Well, at the end of rendering the <literal>m:message</literal> the
<literal>mailSession</literal> is called to send the email, so all you
have to do is ask Seam to render the view:
</para>
<programlisting role="JAVA"><![CDATA[@In(create=true)
private Renderer renderer;
public void send() {
try {
renderer.render("/simple.xhtml");
facesMessages.add("Email sent successfully");
}
catch (Exception e) {
facesMessages.add("Email sending failed: " + e.getMessage());
}
}]]></programlisting>
<para>
If, for example, you entered an invalid email address, then an exception
would be thrown, which is caught and then displayed to the user.
</para>
<section>
<title>Attachments</title>
<para>
Seam makes it easy to attach files to an email. It supports most of
the standard java types used when working with files.
</para>
<para>
If you wanted to email the <literal>jboss-seam-mail.jar</literal>:
</para>
<programlisting role="XHTML"><![CDATA[<m:attachment value="/WEB-INF/lib/jboss-seam-mail.jar"/>]]></programlisting>
<para>
Seam will load the file from the classpath, and attach it to the email.
By default it would be attached as <literal>jboss-seam-mail.jar</literal>;
if you wanted it to have another name you would just add the <literal>fileName</literal> attribute:
</para>
<programlisting role="XHTML"><![CDATA[<m:attachment value="/WEB-INF/lib/jboss-seam-mail.jar" fileName="this-is-so-cool.jar"/>]]></programlisting>
<para>
You could also attach a <literal>java.io.File</literal>, a <literal>java.net.URL</literal>:
</para>
<programlisting role="XHTML"><![CDATA[<m:attachment value="#{numbers}"/>]]></programlisting>
<para>
Or a <literal>byte[]</literal> or a <literal>java.io.InputStream</literal>:
</para>
<programlisting role="XHTML"><![CDATA[<m:attachment value="#{person.photo}" contentType="image/png"/>]]></programlisting>
<para>
You'll notice that for a <literal>byte[]</literal> and a <literal>java.io.InputStream</literal>
you need to specify the MIME type of the attachment (as that
information is not carried as part of the file).
</para>
<para>
And it gets even better, you can attach a Seam generated PDF, or any
standard JSF view, just by wrapping a <literal><m:attachment></literal>
around the normal tags you would use:
</para>
<programlisting role="XHTML"><![CDATA[<m:attachment fileName="tiny.pdf">
<p:document>
A very tiny PDF
</p:document>
</m:attachment>]]></programlisting>
<para>
If you had a set of files you wanted to attach (for example a set of
pictures loaded from a database) you can just use a <literal><ui:repeat></literal>:
</para>
<programlisting role="XHTML"><![CDATA[<ui:repeat value="#{people}" var="person">
<m:attachment value="#{person.photo}" contentType="image/jpeg" fileName="#{person.firstname}_#{person.lastname}.jpg"/>
</ui:repeat>]]></programlisting>
<para>
And if you want to display an attached image inline:
</para>
<programlisting role="XHTML"><![CDATA[<m:attachment
value="#{person.photo}"
contentType="image/jpeg"
fileName="#{person.firstname}_#{person.lastname}.jpg"
status="personPhoto"
disposition="inline" />
<img src="cid:#{personPhoto.contentId}" />]]></programlisting>
<para>
You may be wondering what <literal>cid:#{...}</literal> does. Well, the
IETF specified that by putting this as the src for your image, the
attachments will be looked at when trying to locate the image (the
<literal>Content-ID</literal>'s must match) — magic!
</para>
<para>
You must declare the attachment before trying to access the status object.
</para>
</section>
<section>
<title>HTML/Text alternative part</title>
<para>
Whilst most mail readers nowadays support HTML, some don't, so you can
add a plain text alternative to your email body:
</para>
<programlisting role="XHTML"><![CDATA[<m:body>
<f:facet name="alternative">Sorry, your email reader can't show our fancy email,
please go to http://labs.jboss.com/jbossseam to explore Seam.</f:facet>
</m:body>]]></programlisting>
</section>
<section>
<title>Multiple recipients</title>
<para>
Often you'll want to send an email to a group of recipients (for
example your users). All of the recipient mail tags can be placed
inside a <literal><ui:repeat></literal>:
</para>
<programlisting role="XHTML"><![CDATA[<ui:repeat value="#{allUsers} var="user">
<m:to name="#{user.firstname} #{user.lastname}" address="#{user.emailAddress}" />
</ui:repeat>]]></programlisting>
</section>
<section>
<title>Multiple messages</title>
<para>
Sometimes, however, you need to send a slightly different message to
each recipient (e.g. a password reset). The best way to do this is to
place the whole message inside a <literal><ui:repeat></literal>:
</para>
<programlisting role="XHTML"><![CDATA[<ui:repeat value="#{people}" var="p">
<m:message>
<m:from name="#{person.firstname} #{person.lastname}">#{person.address}</m:from>
<m:to name="#{p.firstname}">#{p.address}</m:to>
...
</m:message>
</ui:repeat>]]></programlisting>
</section>
<section>
<title>Templating</title>
<para>
The mail templating example shows that facelets templating just works
with the Seam mail tags.
</para>
<para>
Our <literal>template.xhtml</literal> contains:
</para>
<programlisting role="XHTML"><![CDATA[<m:message>
<m:from name="Seam" address="[email protected]" />
<m:to name="#{person.firstname} #{person.lastname}">#{person.address}</m:to>
<m:subject>#{subject}</m:subject>
<m:body>
<html>
<body>
<ui:insert name="body">This is the default body, specified by the template.</ui:insert>
</body>
</html>
</m:body>
</m:message>]]></programlisting>
<para>
Our <literal>templating.xhtml</literal> contains:
</para>
<programlisting role="XHTML"><![CDATA[<ui:param name="subject" value="Templating with Seam Mail"/>
<ui:define name="body">
<p>This example demonstrates that you can easily use <i>facelets templating</i> in email!</p>
</ui:define>]]></programlisting>
<para>
You can also use facelets source tags in your email, but you must place
them in a jar in <literal>WEB-INF/lib</literal> - referencing the
<literal>.taglib.xml</literal> from <literal>web.xml</literal> isn't
reliable when using Seam Mail (if you send your mail asynchronously
Seam Mail doesn't have access to the full JSF or Servlet context, and
so doesn't know about <literal>web.xml</literal> configuration
parameters).
</para>
<para>
If you do need more configure Facelets or JSF when sending mail, you'll
need to override the Renderer component and do the configuration
programmatically - only for advanced users!
</para>
</section>
<section>
<title>Internationalisation</title>
<para>
Seam supports sending internationalised messages. By default, the
encoding provided by JSF is used, but this can be overridden on the
template:
</para>
<programlisting role="XHTML"><![CDATA[<m:message charset="UTF-8">
...
</m:message>]]></programlisting>
<para>
The body, subject and recipient (and from) name will be encoded.
You'll need to make sure facelets uses the correct charset for parsing
your pages by setting encoding of the template:
</para>
<programlisting role="XHTML"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>]]></programlisting>
</section>
<section>
<title>Other Headers</title>
<para>
Sometimes you'll want to add other headers to your email. Seam
provides support for some (see <xref linkend="mail.tags" />). For
example, we can set the importance of the email, and ask for a read
receipt:
</para>
<programlisting role="XHTML"><![CDATA[<m:message xmlns:m="http://jboss.org/schema/seam/mail"
importance="low"
requestReadReceipt="true"/>]]></programlisting>
<para>
Otherwise you can add any header to the message using the
<literal><m:header></literal> tag:
</para>
<programlisting role="XHTML"><![CDATA[<m:header name="X-Sent-From" value="JBoss Seam"/>]]></programlisting>
</section>
</section>
<section>
<title>Receiving emails</title>
<warning>Please be reminded that this section is not updated for JBoss AS 7.x!</warning>
<para>
If you are using EJB then you can use a MDB (Message Driven Bean) to
receive email. JBoss provides a JCA adaptor —
<literal>mail-ra.rar</literal> — but the version distributed with
JBoss AS 4.x has a number of limitations (and isn't bundled in some versions)
therefore we recommend using the <literal>mail-ra.rar</literal>
distributed with Seam (it's in the <literal>extras/</literal>
directory in the Seam bundle). <literal>mail-ra.rar</literal> should
be placed in <literal>$JBOSS_HOME/server/default/deploy</literal>; if the
version of JBoss AS you use already has this file, replace it.
</para>
<note>
<para>JBoss AS 5.x and newer has mail-ra.rar applied the patches,
so there is no need to copy the mail-ra.rar from Seam distribution.</para>
</note>
<para>
You can configure it like this:
</para>
<programlisting role="JAVA"><![CDATA[@MessageDriven(activationConfig={
@ActivationConfigProperty(propertyName="mailServer", propertyValue="localhost"),
@ActivationConfigProperty(propertyName="mailFolder", propertyValue="INBOX"),
@ActivationConfigProperty(propertyName="storeProtocol", propertyValue="pop3"),
@ActivationConfigProperty(propertyName="userName", propertyValue="seam"),
@ActivationConfigProperty(propertyName="password", propertyValue="seam")
})
@ResourceAdapter("mail-ra.rar")
@Name("mailListener")
public class MailListenerMDB implements MailListener {
@In(create=true)
private OrderProcessor orderProcessor;
public void onMessage(Message message) {
// Process the message
orderProcessor.process(message.getSubject());
}
}]]></programlisting>
<para>
Each message received will cause <literal>onMessage(Message message)</literal>
to be called. Most Seam annotations will work inside a MDB but you
must not access the persistence context.
</para>
<para>
You can find more information on <literal>mail-ra.rar</literal>
at <ulink url="http://www.jboss.org/community/wiki/InboundJavaMail">http://www.jboss.org/community/wiki/InboundJavaMail</ulink>.
</para>
<para>
If you aren't using JBoss AS you can still use <literal>mail-ra.rar</literal>
or you may find your application server includes a similar adapter.
</para>
</section>
<section>
<title>Configuration</title>
<para>
To include Email support in your application, include <literal>jboss-seam-mail.jar</literal>
in your <literal>WEB-INF/lib</literal> directory. If you are using JBoss
AS there is no further configuration needed to use Seam's email support.
Otherwise you need to make sure you have the JavaMail API, an
implementation of the JavaMail API present (the API and impl used in
JBoss AS are distributed with seam as <literal>lib/mail.jar</literal>),
and a copy of the Java Activation Framework (distributed with Seam as
<literal>lib/activation.jar</literal>.
</para>
<note>
<para>
The Seam Mail module requires the use of Facelets as the view
technology. This is the default View technology in JSF 2.
Additionally, it requires the use of the jboss-seam-ui module.
</para>
</note>
<para>
The <literal>mailSession</literal> component uses JavaMail to talk to a
'real' SMTP server.
</para>
<section>
<title><literal>mailSession</literal></title>
<para>
A JavaMail Session may be available via a JNDI lookup if you are
working in an JEE environment or you can use a Seam configured Session.
</para>
<para>
The mailSession component's properties are described in more detail in
<xref linkend="components.mail"/>.
</para>
<section>
<title>JNDI lookup in JBoss AS</title>
<para>
The JBoss AS 7 Mail service is defined in <filename>standalone/configuration/standalone.xml</filename> file. It configures a
JavaMail session binding into JNDI. The default service
configuration will need altering for your network.
<ulink url="http://www.mastertheboss.com/jboss-application-server/379-jboss-mail-service-configuration.html">Full article how to configure Mail system in JBoss AS 7</ulink>
describes the service in more detail.
</para>
<programlisting role="XML"><![CDATA[<components xmlns="http://jboss.org/schema/seam/components"
xmlns:core="http://jboss.org/schema/seam/core"
xmlns:mail="http://jboss.org/schema/seam/mail">
<mail:mail-session session-jndi-name="java:jboss/mail/Default"/>
</components>]]></programlisting>
<para>
Here we tell Seam to get the mail session bound to
<literal>java:jboss/mail/Default</literal> from JNDI.
</para>
</section>
<section>
<title>Seam configured Session</title>
<para>
A mail session can be configured via <literal>components.xml</literal>.
Here we tell Seam to use <literal>smtp.example.com</literal> as the
smtp server:
</para>
<programlisting role="XML"><![CDATA[<components xmlns="http://jboss.org/schema/seam/components"
xmlns:core="http://jboss.org/schema/seam/core"
xmlns:mail="http://jboss.org/schema/seam/mail">
<mail:mail-session host="smtp.example.com"/>
</components>]]></programlisting>
</section>
</section>
</section>
<section id="mail.tags">
<title>Tags</title>
<para>
Emails are generated using tags in the <literal>http://jboss.org/schema/seam/mail</literal>
namespace. Documents should always have the <literal>message</literal>
tag at the root of the message. The message tag prepares Seam to generate
an email.
</para>
<para>
The standard templating tags of facelets can be used as normal. Inside
the body you can use any JSF tag; if it requires access to external
resources (stylesheets, javascript) then be sure to set the
<literal>urlBase</literal>.
</para>
<variablelist>
<varlistentry>
<term><m:message></term>
<listitem>
<para>
Root tag of a mail message
</para>
<itemizedlist>
<listitem>
<para>
<literal>importance</literal> — low, normal or high. By
default normal, this sets the importance of the mail message.
</para>
</listitem>
<listitem>
<para>
<literal>precedence</literal> — sets the precedence of
the message (e.g. bulk).
</para>
</listitem>
<listitem>
<para>
<literal>requestReadReceipt</literal> — by default false,
if set, a read receipt request will be will be added, with the
read receipt being sent to the <literal>From:</literal>
address.
</para>
</listitem>
<listitem>
<para>
<literal>urlBase</literal> — If set, the value is
prepended to the <literal>requestContextPath</literal> allowing
you to use components such as
<literal><h:graphicImage></literal> in your emails.
</para>
</listitem>
<listitem>
<para>
<literal>messageId</literal> — Sets the Message-ID explicitly
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry>
<term><m:from></term>
<listitem>
<para>
Set's the From: address for the email. You can only have one of
these per email.
</para>
<itemizedlist>
<listitem>
<para>
<literal>name</literal> — the name the email should come
from.
</para>
</listitem>
<listitem>
<para>
<literal>address</literal> — the email address the email
should come from.
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry>
<term><m:replyTo></term>
<listitem>
<para>
Set's the Reply-to: address for the email. You can only have one
of these per email.
</para>
<itemizedlist>
<listitem>
<para>
<literal>address</literal> — the email address the email
should come from.
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry>
<term><m:to></term>
<listitem>
<para>
Add a recipient to the email. Use multiple <m:to> tags for
multiple recipients. This tag can be safely placed inside a repeat
tag such as <ui:repeat>.
</para>
<itemizedlist>
<listitem>
<para>
<literal>name</literal> — the name of the recipient.
</para>
</listitem>
<listitem>
<para>
<literal>address</literal> — the email address of the recipient.
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry>
<term><m:cc></term>
<listitem>
<para>
Add a cc recipient to the email. Use multiple <m:cc> tags
for multiple ccs. This tag can be safely placed inside a iterator
tag such as <ui:repeat>.
</para>
<itemizedlist>
<listitem>
<para>
<literal>name</literal> — the name of the recipient.
</para>
</listitem>
<listitem>
<para>
<literal>address</literal> — the email address of the
recipient.
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry>
<term><m:bcc></term>
<listitem>
<para>
Add a bcc recipient to the email. Use multiple <m:bcc>
tags for multiple bccs. This tag can be safely placed inside a
repeat tag such as <ui:repeat>.
</para>
<itemizedlist>
<listitem>
<para>
<literal>name</literal> — the name of the recipient.
</para>
</listitem>
<listitem>
<para>
<literal>address</literal> — the email address of the
recipient.
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry>
<term><m:header></term>
<listitem>
<para>
Add a header to the email (e.g. <literal>X-Sent-From: JBoss Seam</literal>)
</para>
<itemizedlist>
<listitem>
<para>
<literal>name</literal> — The name of the header to
add (e.g. <literal>X-Sent-From</literal>).
</para>
</listitem>
<listitem>
<para>
<literal>value</literal> — The value of the header to
add (e.g. <literal>JBoss Seam</literal>).
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry>
<term><m:attachment></term>
<listitem>
<para>
Add an attachment to the email.
</para>
<itemizedlist>
<listitem>
<para>
<literal>value</literal> — The file to attach:
</para>
<itemizedlist>
<listitem>
<para>
<literal>String</literal> — A <literal>String</literal>
is interpreted as a path to file within the classpath
</para>
</listitem>
<listitem>
<para>
<literal>java.io.File</literal> — An EL expression
can reference a <literal>File</literal> object
</para>
</listitem>
<listitem>
<para>
<literal>java.net.URL</literal> — An EL expression
can reference a <literal>URL</literal> object
</para>
</listitem>
<listitem>
<para>
<literal>java.io.InputStream</literal> — An EL
expression can reference an <literal>InputStream</literal>.
In this case both a <literal>fileName</literal> and a
<literal>contentType</literal> must be specified.
</para>
</listitem>
<listitem>
<para>
<literal>byte[]</literal> — An EL expression can
reference an <literal>byte[]</literal>. In this case both
a <literal>fileName</literal> and a
<literal>contentType</literal> must be specified.
</para>
</listitem>
</itemizedlist>
<para>If the value attribute is ommitted:</para>
<itemizedlist>
<listitem>
<para>
If this tag contains a <literal><p:document></literal>
tag, the document described will be generated and
attached to the email. A <literal>fileName</literal>
should be specified.
</para>
</listitem>
<listitem>
<para>
If this tag contains other JSF tags a HTML document will
be generated from them and attached to the email. A
<literal>fileName</literal> should be specified.
</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>
<literal>fileName</literal> — Specify the file name to
use for the attached file.
</para>
</listitem>
<listitem>
<para>
<literal>contentType</literal> — Specify the MIME type
of the attached file
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry>
<term><m:subject></term>
<listitem>
<para>
Set's the subject for the email.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><m:body></term>
<listitem>
<para>
Set's the body for the email. Supports an <literal>alternative</literal>
facet which, if an HTML email is generated can contain
alternative text for a mail reader which doesn't support html.
</para>
<itemizedlist>
<listitem>
<para>
<literal>type</literal> — If set to <literal>plain</literal>
then a plain text email will be generated otherwise an HTML
email is generated.
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
</variablelist>
</section>
</chapter>