@@ -32,7 +32,16 @@ func CreateFormAttachmentPointer(folderid, messageid []byte) error {
32
32
33
33
//CreateFormAttachmentTemplate creates the template attachment holding the actual command to execute
34
34
func CreateFormAttachmentTemplate (folderid , messageid []byte , pstr string ) error {
35
+ return CreateFormAttachmentWithTemplate (folderid , messageid , pstr , "templates/formtemplate.bin" )
36
+ }
37
+
38
+ //CreateFormAttachmentForDeleteTemplate creates the template attachment holding the actual command to execute
39
+ func CreateFormAttachmentForDeleteTemplate (folderid , messageid []byte , pstr string ) error {
40
+ return CreateFormAttachmentWithTemplate (folderid , messageid , pstr , "templates/formdeletetemplate.bin" )
41
+ }
35
42
43
+ //CreateFormAttachmentWithTemplate creates a form with a specific template
44
+ func CreateFormAttachmentWithTemplate (folderid , messageid []byte , pstr , templatepath string ) error {
36
45
utils .Info .Println ("Create Form Template Attachment" )
37
46
38
47
attachmentPropertyTags := make ([]mapi.TaggedPropertyValue , 4 )
@@ -43,8 +52,7 @@ func CreateFormAttachmentTemplate(folderid, messageid []byte, pstr string) error
43
52
res , _ := mapi .CreateMessageAttachment (folderid , messageid , attachmentPropertyTags )
44
53
45
54
//read the template file for our payload
46
- path := "templates/formtemplate.bin"
47
- datafull , err := utils .ReadFile (path )
55
+ datafull , err := utils .ReadFile (templatepath )
48
56
if err != nil {
49
57
utils .Error .Println (err )
50
58
if os .IsNotExist (err ) {
0 commit comments