2022.2

Table Of Contents
Parts:splittingandrenamingemailattachments
InaControlScript,partscanbedefinedtodeterminewhichsectionsshouldbeoutputtothesamefile.
ThiswayitispossibletosplitthePrintcontextortheWebcontextintomultipleemailattachments.This
topicshowshowtodothat.
ForinformationaboutControlScriptsingeneral,see"ControlScripts"onpage838and"ControlScript
API"onpage1271.Ifyoudon'tknowhowtowritescripts,see"Writingyourownscripts"onpage808.
Defining parts
Definingpartsisdonebysettingthepartfieldonasection,forexample:
merge.template.contexts.PRINT.sections['Section 2'].part = "PDF_Attachment2";.
(Alsosee"section"onpage1305and"ControlScriptAPI"onpage1271.)
l
Ifapartnameisgiven,thenthatdelimitsthestartofanewpart(evenifthepartnameisthesame
asthepreviousone).Followingsectionsthatdon'tdefineapartname,willbeaddedtothepre-
viouspart.
l
Apartendsatthelastenabled*sectionoratthelastsectionbeforethestartofanewpart.
*WhenaControlScripthassettheenabledfieldofasectiontofalse,itwillnotbeout-
putted.
Ifnopartnameissetonanysection,itisassumedthatthereisonlyonepart,consistingofthedefault
section(forWeboutput)orofallsections(forPrintoutput).Theattachment(s)willbenamedafterthe
emailsubject.
Examples
No parts defined
AssumetherearethreePrintsections:sectionsA,BandC.WhengeneratingEmailoutputwiththe
Printcontextasattachment,allthreePrintsectionswillbeputtogetherinonefileandattachedtothe
email.Iftheemail'ssubjectis'Takeaction',thenameoftheattachedfilewillbe'Takeaction.PDF'.
Splitting and renaming a Print attachment
AssumetherearethreePrintsections:sectionsA,BandC.InaControlScriptapartnameisdefined
forsectionC:
var section = merge.template.contexts.PRINT.sections['Section C'];
section.part = 'Part2';
Page 843