#BLOCK("WITH_FORM_ERROR",#FormError)
{EMailsToUser} {EMailsToAdmin}
#IF(#FormError)
#IF(#FormErrors.Reason.MISSING_TO_ADDRESS )

{InputError}

{CanNotActivate_MissingToAddress} #ELSE

{InputError}

{PleaseCorrectErrors} #ENDIF
#ELSE #IF(NOT #MailFrom)

{Attention}

{InsertSenderAddressFirst}
{GotoEmailSettings}
#ENDIF #ENDIF
#GUI("accordion") #LOOP(#System.Child.MailTypeTemplateGroups.ChildObjects) #GUI.item( "title" = {(#NameOrAlias )}, "content" = {( #LOOP(#MAILTYPETEMPLATES(#Object)) #IF(NOT #MailFrom) #ELSE #LOCAL("DisplayFeature", #FeaturedActionAvailable(#Shop.Object, #Object)) #IF(#DisplayFeature NE "NotVisible") #LOCAL("_Error", #GET("FormErrorAlias.".#Alias)) #IF(#DisplayFeature EQ "NotAllowed") #ELSE #IF(#FUNCTION("EXISTSCHILD", #Shop.Child.MailTypes.Object, #Alias)) #WITH(#FUNCTION("CHILD", #Shop.Child.MailTypes.Object, #Alias)) #ENDWITH #ELSE #ENDIF #ENDIF #SET("Alternate", 1-#Alternate) #ENDLOCAL #ENDIF #ENDLOCAL #ENDIF #ENDLOOP
{Event} {Subject} {active}
#NameOrAlias #IF(#MailTypeTemplate.Description) #MailTypeTemplate.Description #ENDIF #Subject
#NameOrAlias #Subject #MailTypeTemplate.NameOrAlias #IF(#MailTypeTemplate.Description) #MailTypeTemplate.Description #ENDIF #Subject #NameOrAlias #IF(#Description) #Description #ENDIF #Subject
)} ) #ENDLOOP #ENDGUI
#LOOP(#MAILTYPETEMPLATESADMIN(#Shop)) #LOCAL("DisplayFeature", #FeaturedActionAvailable(#Shop.Object, #Object)) #IF(#DisplayFeature NE "NotVisible") #LOCAL("_Error", #GET("FormErrorAlias.".#Alias)) #IF(#DisplayFeature EQ "NotAllowed") #ELSE #IF(#FUNCTION("EXISTSCHILD", #Shop.Child.MailTypes.Object, #Alias)) #WITH(#FUNCTION("CHILD", #Shop.Child.MailTypes.Object, #Alias)) #ENDWITH #ELSE #ENDIF #ENDIF #SET("Alternate", 1-#Alternate) #ENDLOCAL #ENDIF #ENDLOCAL #ENDLOOP
{Event} {Subject} {active}
#NameOrAlias #Subject #MailTypeTemplate.NameOrAlias #IF(#MailTypeTemplate.Description) #MailTypeTemplate.Description #ENDIF #Subject #NameOrAlias #IF(#Description) #Description #ENDIF #Subject
#REM#ENDREM #ENDBLOCK