Hi All,
Has anyone implemented header and footer concepts for email templates? If yes, could you please guide me?
If available, kindly share a sample snippet. I have tried multiple approaches, but they are not working as expected.
Thanks in advance
Hi All,
Has anyone implemented header and footer concepts for email templates? If yes, could you please guide me?
If available, kindly share a sample snippet. I have tried multiple approaches, but they are not working as expected.
Thanks in advance
There are multiple ways to include a header and footer in your email template:
Using Separate Email Templates:
You can create separate email templates specifically for the header and footer. These components can then be referenced within your main email template. This approach promotes reusability and consistency, especially if the same header and footer are used across multiple templates.
Embedding Directly in the Main Template:
Alternatively, you can include the header and footer content directly within the main email template. This method might be simpler for smaller or one-off templates but offers less flexibility for future updates or reuse.
Thanks for the @msingh900 .
Do we have any sample or example for using separate email template.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE EmailTemplate PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<EmailTemplate name="Approver-Notification">
<Body>
#set( $ctx = $spTools.class.forName("sailpoint.api.SailPointFactory").getMethod("getFactory", null).invoke(null, null).getCurrentContext() )
#evaluate( $ctx.getObjectByName($spTools.class.forName("sailpoint.object.EmailTemplate"), "EmailTemplate123").body )
#set( $workItemUrl = $spTools.formatURL("/workitem/commonWorkItem.jsf#/commonWorkItem/" + "0a4b883b9275173d819277c9a8f10b40") )
#@CommonTemplate()
#@CommonHeaderSection( "Update" )
<p> Update <p>
#end
#@CommonSection( "Information" )
<p> This is to notify on the changes made in the halo Updates.<p>
#@dataTable()
#@dataTableRow( "Identity Name" )
$identityDisplayName
#end
#@dataTableRow( "Current Sys Owner" )
$currSysOwnerDisp
#end
#@dataTableRow( "New Sys Owner" )
$displaynamenewManager
#end
#end
#end
#end
</Body>
<Description>
Email sent to approver for Update.
</Description>
<Signature>
<Inputs>
<Argument name="identityDisplayName"/>
<Argument name="currSysOwnerDisp"/>
<Argument name="displaynamenewManager"/>
</Inputs>
</Signature>
<Subject> ** No Action Required ** Request completed for Update </Subject>
</EmailTemplate>
In this email template “EmailTemplate123“ you need to define the macro for the commonTemplate, dataTable and etc.
Use the above one as sample where you can call another emailtemplate xml object.