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 package info.magnolia.module.mail.setup;
35
36 import info.magnolia.cms.beans.config.ContentRepository;
37 import info.magnolia.cms.core.ItemType;
38 import info.magnolia.module.delta.ArrayDelegateTask;
39 import info.magnolia.module.delta.CreateNodeTask;
40 import info.magnolia.module.delta.NewPropertyTask;
41 import info.magnolia.module.delta.Task;
42
43
44
45
46
47
48 public class AddMailTemplateTask extends ArrayDelegateTask {
49
50
51 public AddMailTemplateTask(String templateName, String description, String from, String subject, String templatePath, String type) {
52 super("Mail template", "Adds the " + templateName + " " + description + ".", new Task[]{
53 new CreateNodeTask(null, null, ContentRepository.CONFIG, "/modules/mail/config/templatesConfiguration", templateName, ItemType.CONTENTNODE.getSystemName()),
54 new NewPropertyTask(null, null, ContentRepository.CONFIG, "/modules/mail/config/templatesConfiguration/" + templateName, "from", from),
55 new NewPropertyTask(null, null, ContentRepository.CONFIG, "/modules/mail/config/templatesConfiguration/" + templateName, "subject", subject),
56 new NewPropertyTask(null, null, ContentRepository.CONFIG, "/modules/mail/config/templatesConfiguration/" + templateName, "body", templatePath),
57 new NewPropertyTask(null, null, ContentRepository.CONFIG, "/modules/mail/config/templatesConfiguration/" + templateName, "type", type)
58 });
59 }
60 }