2022.2

Table Of Contents
Thechanneldoesn'tchangewhentheoutputconsistsofdifferentcontexts.Whengeneratingemail,for
example,thechannelisEMAIL,evenwhenmergingthePrintcontexttoattachittotheemail.
Value Description
EMAIL
ThemergerequestisforoutputtoEmail.
PRINT
ThemergerequestisforoutputtoPrint.
WEB
ThemergerequestisforoutputtoWeb.
THUMBNAIL
Themergerequestisforgeneratingatemplatepreview.
Example
ThefollowingControlScriptselectsdifferentsectionsforPrintoutputandforEmailwiththePrintcon-
textattachedtoit.
var printSections = merge.template.contexts.PRINT.sections;
if(merge.channel === Channel.EMAIL){
printSections['Section 1'].enabled = false;
printSections['Section 2'].enabled = true;
}
if(merge.channel === Channel.PRINT){
printSections['Section 1'].enabled = true;
printSections['Section 2'].enabled = false;
}
ContextType
ContextTypeisanenumerationforthecontexttypes.
Thetypeofthecontextthatisgoingtobemergednextcanberetrievedviamerge.context.type.
Thecontexttypeneedstobespecifiedwhenretrievingasectionwithmerge.tem-
plate.contexts.ContextType.sections["section name"],forexamplemerge.tem-
plate.contexts.PRINT.sections["Section EN"].
Value Description
HTML_EMAIL
ThecontextistheEmailcontext.
PRINT
ThecontextisthePrintcontext.
WEB
ThecontextistheWebcontext.
Page 1295