1 |
<?xml version="1.0" encoding="UTF-8"?> |
2 |
<!DOCTYPE document PUBLIC |
3 |
"-//Apache Software Foundation//DTD XDOC 1.0//EN" |
4 |
"http://maven.apache.org/dtd/xdoc_1_0.dtd"> |
5 |
<!-- |
6 |
Copyright 2011 Hippo |
7 |
|
8 |
Licensed under the Apache License, Version 2.0 (the "License"); |
9 |
you may not use this file except in compliance with the License. |
10 |
You may obtain a copy of the License at |
11 |
|
12 |
http://www.apache.org/licenses/LICENSE-2.0 |
13 |
|
14 |
Unless required by applicable law or agreed to in writing, software |
15 |
distributed under the License is distributed on an "AS IS" |
16 |
BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
17 |
See the License for the specific language governing permissions and |
18 |
limitations under the License. |
19 |
--> |
20 |
<document> |
21 |
<properties> |
22 |
<title>Send email with event information</title> |
23 |
</properties> |
24 |
<body> |
25 |
<section name="Introduction"> |
26 |
<p>This allows you to send an email with an iCalendar (.ics) attachment for the event data. Some mail clients, |
27 |
like Google mail, automatically recognize these attachments and let you add the event directly to your calendar. |
28 |
</p> |
29 |
<p>This documentation is meant for developers who understand the |
30 |
<a href="https://wiki.onehippo.com/display/CMS7/Grazing+Hippo">Grazing Hippo</a> level.</p> |
31 |
</section> |
32 |
<section name="Setup"> |
33 |
<subsection name="Dependencies"> |
34 |
<p>Add the following dependency to the pom of your website subproject:</p> |
35 |
<pre> |
36 |
<![CDATA[ |
37 |
<dependency> |
38 |
<groupId>org.onehippo.forge.socialsharing</groupId> |
39 |
<artifactId>socialsharing</artifactId> |
40 |
</dependency> |
41 |
]]> </pre> |
42 |
<p>Add the following dependencies to your application container. You can either add them as runtime dependency |
43 |
to your pom, or add the jars directly to the lib directory of e.g. Tomcat.</p> |
44 |
<pre> |
45 |
<![CDATA[ |
46 |
<dependency> |
47 |
<groupId>javax.activation</groupId> |
48 |
<artifactId>activation</artifactId> |
49 |
<scope>runtime</scope> |
50 |
</dependency> |
51 |
<dependency> |
52 |
<groupId>javax.mail</groupId> |
53 |
<artifactId>mail</artifactId> |
54 |
<scope>runtime</scope> |
55 |
</dependency> |
56 |
]]> </pre> |
57 |
</subsection> |
58 |
</section> |
59 |
<section name="HST configuration"> |
60 |
<subsection name="Create a bean for the event"> |
61 |
<p>Create a bean for the event, meeting or course that extends the HippoBean (may extend it indirectly via |
62 |
your project's base bean) and implements org.onehippo.forge.socialsharing.beans.IEventDocument. </p> |
63 |
</subsection> |
64 |
<subsection name="Create a rendering template"> |
65 |
<p>Create a rendering template for the form in which your visitor can enter his or her email address to receive |
66 |
the iCalendar data. The minimal form is:</p> |
67 |
<pre> |
68 |
<![CDATA[ |
69 |
<%@ taglib uri="http://www.hippoecm.org/jsp/hst/core" prefix='hst'%> |
70 |
<form class="form" action="<hst:actionURL />" method="post"> |
71 |
<fieldset> |
72 |
<label for="calendaremail">Email address</label> |
73 |
<input type="text" name="email" id="calendaremail" class="input"/> |
74 |
<input type="submit" value="Send event information" class="submit fright"/> |
75 |
</fieldset> |
76 |
</form> |
77 |
]]> </pre> |
78 |
</subsection> |
79 |
<subsection name="HST Component"> |
80 |
<p>The easiest way is to add a component to your page that uses |
81 |
org.onehippo.forge.socialsharing.components.AddToCalendar as hst:componentclassname. You can also extend this |
82 |
class if your doAction method needs to do more than just mail the event data. Link the component to the rendering |
83 |
template made in the previous step. Don't forget to configure the required component parameters mailhost, mailport |
84 |
and fromAddress.</p> |
85 |
</subsection> |
86 |
</section> |
87 |
<section name="How to use it"> |
88 |
<p>Now you are ready to create documents with event, meeting or course data. In the front end the visitor sees a |
89 |
form to fill in his or her email address.</p> |
90 |
<p>After submitting the form, the visitor receives an email with an |
91 |
iCalendar attachment (invite.ics). Some email applications recognize these mails as event invitations. |
92 |
Otherwise you can open the attachment in your calendaring application.</p> |
93 |
<subsection name="Example invitation"> |
94 |
<p><img src="images/AddToCalendarEmail.png" alt="Screenshot of email with icalendar invitation"/></p> |
95 |
</subsection> |
96 |
</section> |
97 |
|
98 |
</body> |
99 |
</document> |