{{ . }}
to output a value{{ .FieldName }}
to access a field of an object{{ .MethodName }}
to call a method on an object{{ if }} {{ else }} {{ end }}
for conditionals{{ range . }} {{ . }} {{ end }}
to iterate over a slice- Functions can be called like
{{ FuncName . }}
or just{{ FuncName }}
- Public Pages Templates: Render the portal’s publicly accessible pages (such as Home, About Us, and Blog pages), forming the foundation of your portal’s public-facing content. These can be customized through the Pages section of the admin dashboard.
- Private Pages Templates: Responsible for rendering the portal’s authenticated user pages, like Profile settings and My Apps.
- Email Templates: Define the structure and content of emails sent by the portal, such as signup confirmations or access request approvals.
- Template Data: Detailed explanation of the data structures available in different templates.
- Global Helper Functions: A list of global functions that can be used across templates to manipulate and display data.
- Email Templates: Information about email-specific templates and their available data.
Template Data
This section outlines the Tyk Enterprise Developer Portal templates that have access to specific template data. It’s important to note that data availability varies between templates, depending on their context and purpose. For instance, a product detail template has access to product-specific data that may not be available in a blog listing template.Templates with specific template data
- Analytics
- Application Create
- Application Detail
- Blogs
- Blog Detail
- Cart Checkout
- Organization User Detail
- Organization User Edit
- Organization Users List
- Product Detail
- Product OAS Documentation
Analytics
Template Path:themes/default/views/analytics.tmpl
This template is used to render the analytics page.
Available Objects
{{ .errors }}
: Map of template errors (Key: category, Value: error message){{ .apps }}
: List of available applications
Application Attributes
Accessible via{{ range .apps }}
Attribute | Description |
---|---|
{{ .ID }} | Application ID |
{{ .Name }} | Application name |
{{ .Description }} | Application description |
{{ .RedirectURLs }} | Application redirect URLs |
Example Usage
Application Create
Template Path:themes/default/views/app_form_create.tmpl
This template is used to render the application creation form.
Available Objects
{{ .errors }}
: Map of template errors (Key: category, Value: error message)
Example Usage
Application Detail
Template Path:themes/default/views/app_form_update.tmpl
This template is used to render the application detail and update form.
Available Objects
{{ .errors }}
: Map of template errors (Key: category, Value: error message){{ .app }}
: Selected application object.{{ .appCerts }}
: Map of application MTLS certificates if applicable (Key: access request ID, Value: certificate){{ .allCerts }}
: Map of all MTLS certificates stored if applicable (Key: cert fingerprint, Value: cert)
MTLS Certificate Attributes (appCerts)
Attribute | Description |
---|---|
{{ .ID }} | Certificate ID |
{{ .Name }} | Certificate name |
{{ .Fingerprint }} | Certificate fingerprint |
{{ .SignatureAlgorithm }} | Signature algorithm |
{{ .Issuer }} | Certificate issuer |
{{ .IsValid }} | Boolean indicating if the certificate is valid |
{{ .ValidNotBefore }} | Start date of validity |
{{ .ValidNotAfter }} | End date of validity |
{{ .Subject }} | Certificate subject |
MTLS Certificate Attributes (allCerts)
Attribute | Description |
---|---|
{{ .ID }} | Certificate ID |
{{ .Name }} | Certificate name |
Client Attributes
Accessible via{{ .app }}
Attribute | Description |
---|---|
{{ .ID }} | Client ID |
{{ .Name }} | Client name |
{{ .Description }} | Client description |
{{ .RedirectURLs }} | Client redirect URLs |
{{ .Credentials }} | Array of client credentials |
{{ .AccessRequests }} | Array of client access requests |
Client Credentials Attributes
Accessible via{{ range $cred := .app.Credentials }}
Attribute | Description |
---|---|
{{ .ID }} | Credential ID |
{{ .Credential }} | Credential |
{{ .CredentialHash }} | Credential hash |
{{ .OAuthClientID }} | OAuth client ID |
{{ .OAuthClientSecret }} | OAuth client secret |
{{ .Expires }} | Credential expiration |
{{ .AccessRequestID }} | Access request ID associated with the credential |
Client Access Requests Attributes
Accessible via{{ range $acreq := .app.AccessRequests }}
Attribute | Description |
---|---|
{{ .ID }} | Access request ID |
{{ .Status }} | Access request status |
{{ .UserID }} | User ID associated with access request |
{{ .AuthType }} | Access request auth type |
{{ .DCREnabled }} | true if access request DCR enabled |
{{ .ProvisionImmediately }} | true if provisioned immediately is enabled |
{{ .CatalogueID }} | Catalogue ID |
Product Attributes (within Access Request)
Accessible via{{ $product := $acreq.Product }}
Attribute | Description |
---|---|
{{ .ID }} | Product ID |
{{ .Name }} | Product name |
{{ .DisplayName }} | Product display name |
{{ .Path }} | Product path |
{{ .Description }} | Product description |
{{ .Content }} | Product content |
{{ .AuthType }} | Product auth type |
{{ .DCREnabled }} | true if product DCR enabled |
Plan Attributes (within Access Request)
Accessible via{{ $acreq.Plan }}
Attribute | Description |
---|---|
{{ .Name }} | Plan name |
{{ .DisplayName }} | Plan display name |
{{ .Description }} | Plan description |
{{ .AuthType }} | Plan auth type |
{{ .Rate }} | Plan rate |
{{ .Per }} | Plan period |
{{ .QuotaMax }} | Plan quota maximum |
{{ .QuotaRenewalRate }} | Plan quota renewal rate |
{{ .AutoApproveAccessRequests }} | true if auto-approve access requests is enabled |
Example Usage
Blogs
Template Path:themes/default/views/blog_listing.tmpl
This template is used to render the blog listing page.
Available Objects
{{ .posts }}
: List of all published blog posts
Blog Attributes
Accessible via{{ range .posts }}
Attribute | Description |
---|---|
{{ .Title }} | Blog post title |
{{ .Lede }} | Blog post summary |
{{ .Content }} | Blog post content |
{{ .MarkdownContent }} | Markdown content |
{{ .MarkdownEnabled }} | Boolean for Markdown enablement |
{{ .Path }} | Blog post path |
{{ .HeaderImage.URL }} | Header image URL |
{{ .BlogSiteID }} | Blog site ID |
{{ .ProductID }} | Associated product ID |
{{ .AuthorID }} | Author ID |
{{ .URL }} | Full URL of the blog post |
Example Usage
Blog Detail
Template Path:themes/default/views/blog_detail.tmpl
This template is used to render the blog detail page.
Available Objects
{{ .post }}
: The selected blog post object.{{ .latest_posts }}
: List of 3 latest blog posts.
Blog Attributes
Accessible via{{ .post }}
or {{ range .latest_posts }}
Attribute | Description |
---|---|
{{ .Title }} | Blog post title |
{{ .Lede }} | Blog post summary |
{{ .Content }} | Blog post content |
{{ .MarkdownContent }} | Markdown content |
{{ .MarkdownEnabled }} | Boolean for Markdown enablement |
{{ .Path }} | Blog post path |
{{ .HeaderImage.URL }} | Header image URL |
{{ .BlogSiteID }} | Blog site ID |
{{ .ProductID }} | Associated product ID |
{{ .AuthorID }} | Author ID |
{{ .URL }} | Full URL of the blog post |
Example Usage
Cart Checkout
Template Path:themes/default/views/portal_checkout.tmpl
This template is used to render the cart checkout page.
Available Objects
{{ .cart }}
: Map with the cart items for the current user{{ .apps }}
: List of applications for the current user{{ .catalogue_count }}
: Cart catalogues count{{ .certs }}
: List of MTLS certificates if applicable{{ .errors }}
: Map of template errors (Key: category, Value: error message){{ .provisioned }}
: Boolean indicating whether an access request has been provisioned for the cart
Application Attributes
Accessible via{{ range .apps }}
Attribute | Description |
---|---|
{{ .Name }} | Application name |
{{ .Description }} | Application description |
{{ .RedirectURLs }} | Application redirect URLs |
MTLS Certificate Attributes
Accessible via{{ range .certs }}
Attribute | Description |
---|---|
{{ .ID }} | Certificate ID |
{{ .Name }} | Certificate name |
Cart Item Attributes
Accessible via{{ range $key, $value := .cart }}
Attribute | Description |
---|---|
{{ $value.AuthType }} | Cart item auth type |
{{ $value.Catalogue }} | Cart item catalogue |
{{ $value.Products }} | Cart item array of products |
{{ $value.Plan }} | Cart item plan |
{{ $value.DCREnabled }} | true if cart order consists of DCR products |
Plan Attributes (Within cart item)
Accessible via{{ $plan := $value.Plan }}
Attribute | Description |
---|---|
{{ .ID }} | Plan ID |
{{ .PlanName }} | Plan name |
{{ .FormatQuota }} | Formatted quota information |
{{ .FormatRateLimit }} | Formatted rate limit information |
Catalogue Attributes (Within cart item)
Accessible via{{ $catalogue := $value.Catalogue }}
Attribute | Description |
---|---|
{{ .ID }} | Catalogue ID |
Product Attributes (Within cart item)
Accessible via{{ range $product := $value.Products }}
Attribute | Description |
---|---|
{{ .ID }} | Product ID |
{{ .Name }} | Product name |
{{ .DisplayName }} | Product display name |
{{ .Path }} | Product path |
{{ .Description }} | Product description |
{{ .Content }} | Product content |
{{ .AuthType }} | Product auth type |
{{ .DCREnabled }} | true if product DCR enabled |
{{ .AuthTypes }} | List of product auth types |
Auth Type Attributes (Within product)
Accessible via{{ range $auth_type := $product.AuthTypes }}
Attribute | Description |
---|---|
{{ .AuthType }} | Auth type |
DCR Client Template Attributes (Within product)
Accessible via{{ range $template := $product.Templates }}
Attribute | Description |
---|---|
{{ .ID }} | Template ID |
{{ .Name }} | Template name |
{{ .GrantType }} | Template grant type |
{{ .ResponseTypes }} | Template response types |
{{ .TokenEndpointAuthMethod }} | Template token endpoint auth method |
{{ .OktaAppType }} | Template Okta app type |
Organization User Detail
Template Path:themes/default/views/user_detail.tmpl
This template is used to render the organization user detail page.
Available Objects
{{ .errors }}
: Map of template errors (Key: category, Value: error message){{ .user }}
: The organization user object.
User Attributes
Accessible via{{ .user }}
Attribute/Method | Description |
---|---|
{{ .ID }} | User ID |
{{ .First }} | User name |
{{ .Last }} | User surname |
{{ .Email }} | User email |
{{ .OrganisationID }} | User organization ID |
{{ .DisplayName }} | User complete name |
{{ .IdentityProvider }} | User provider (Portal or Tyk Identity Broker) |
{{ .GetOrganisationID }} | User’s organization ID |
{{ .IsAdmin }} | true if user is an admin |
{{ .IsOrgAdmin }} | true if user is an organization admin |
{{ .DisplayRole }} | User’s role |
Organization User Edit
Template Path:themes/default/views/user_edit.tmpl
This template is used to render the edit page for organization user.
Available Objects
{{ .errors }}
: Map of template errors (Key: category, Value: error message){{ .roles }}
: List of possible roles{{ .user }}
: The organization user object.
Role Attributes
Accessible via{{ range .roles }}
Attribute | Description |
---|---|
{{ .ID }} | Role ID |
{{ .DisplayName }} | Role display name |
User Attributes
Accessible via{{ .user }}
Attribute/Method | Description |
---|---|
{{ .ID }} | User ID |
{{ .First }} | User name |
{{ .Last }} | User surname |
{{ .Email }} | User email |
{{ .OrganisationID }} | User organization ID |
{{ .DisplayName }} | User complete name |
{{ .IdentityProvider }} | User provider (Portal or Tyk Identity Broker) |
{{ .GetOrganisationID }} | User’s organization ID |
{{ .IsAdmin }} | true if user is an admin |
{{ .IsOrgAdmin }} | true if user is an organization admin |
{{ .DisplayRole }} | User’s role |
Organization Users List
Template Path:themes/default/views/user_list.tmpl
This template is used to render the list of organization users.
Available Objects
{{ .roles }}
: Map of available roles (Key: role, Value: role display name)
Example Usage
Product Detail
Template Path:themes/default/views/portal_product_detail.tmpl
This template is used to render the product detail page.
Available Objects
{{ .product }}
: The selected product object{{ .catalogues }}
: List of catalogue objects including the selected product{{ .unique_plans }}
: List of plan objects available for the product{{ .scopes }}
: Product scopes as an array of strings{{ .posts }}
: List of related blog post objects{{ .errors }}
: Map of template errors (Key: category, Value: error message){{ .added }}
: Boolean indicating if the product is added to the cart
Product Attributes
Accessible via{{ .product }}
Attribute | Description |
---|---|
{{ .ID }} | Product ID |
{{ .Name }} | Product name |
{{ .DisplayName }} | Product display name |
{{ .Path }} | Product path |
{{ .ReferenceID }} | Product reference ID |
{{ .Description }} | Product description |
{{ .AuthType }} | Product auth type |
{{ .Logo.URL }} | Product logo URL |
{{ .Feature }} | true if the product is featured |
{{ .DCREnabled }} | true if DCR is enabled |
{{ .ProviderID }} | Provider ID |
{{ .Tags }} | List of tags associated with the product |
API Details (Within product)
Accessible via{{ .product.APIDetails }}
Attribute | Description |
---|---|
{{ .Name }} | API name |
{{ .Description }} | API description |
{{ .APIType }} | API type |
{{ .TargetURL }} | API target URL |
{{ .ListenPath }} | API listen path |
{{ .OASUrl }} | API OAS URL |
{{ .Status }} | ”Active” if API status is active, otherwise “Inactive” |
Documentation (Within product)
Accessible via{{ .product.Docs }}
Attribute | Description |
---|---|
{{ .Title }} | Document title |
{{ .ID }} | Document identifier |
{{ .Content }} | Document content |
{{ .MarkdownContent }} | Markdown content |
{{ .MarkdownEnabled }} | Boolean for Markdown enablement |
Product Tags (Within product)
Accessible via{{ .product.Tags }}
Attribute | Description |
---|---|
{{ .ID }} | Tag ID |
{{ .Name }} | Tag name |
Catalogues
Accessible via{{ range .catalogues }}
Attribute | Description |
---|---|
{{ .Name }} | Catalogue name |
{{ .VisibilityStatus }} | Catalogue visibility status |
Plans
Accessible via{{ range .unique_plans }}
Attribute | Description |
---|---|
{{ .Name }} | Plan name |
{{ .ID }} | Plan ID |
{{ .DisplayName }} | Plan display name |
{{ .Description }} | Plan description |
{{ .AuthType }} | Plan authentication type |
{{ .Rate }} | Plan rate |
{{ .Per }} | Plan rate per time unit |
{{ .QuotaMax }} | Plan maximum quota |
{{ .QuotaRenewalRate }} | Plan quota renewal rate |
{{ .AutoApproveAccessRequests }} | Boolean for auto-approval of access requests |
Related Posts
Accessible via{{ range .posts }}
Attribute | Description |
---|---|
{{ .Title }} | Post title |
{{ .Lede }} | Post summary |
{{ .Content }} | Post content |
{{ .MarkdownContent }} | Markdown content |
{{ .MarkdownEnabled }} | Boolean for Markdown enablement |
{{ .Path }} | Post path |
{{ .HeaderImage.URL }} | Header image URL |
{{ .BlogSiteID }} | Blog site ID |
{{ .ProductID }} | Associated product ID |
{{ .AuthorID }} | Author ID |
Product OAS Documentation
Template Paths:themes/default/views/product_doc_stoplight_spec.tmpl
themes/default/views/product_doc_redoc.tmpl
Available Attributes
Attribute | Description |
---|---|
{{ .Name }} | Product name |
{{ .Description }} | Product description |
{{ .Path }} | Product path |
{{ .Url }} | OAS document URL |
Global Helper Functions
This section provides a detailed overview of the global helper functions available in the Tyk Enterprise Developer Portal templates. These functions are accessible across the public and private templates and allow you to perform various operations, retrieve specific data, and create dynamic content within your templates.Available Functions
- CanCreateOrganisation
- Clients
- Current User
- FeaturedProducts
- FilterUserInvites
- FormatTime
- GetCart
- GetCatalogueList
- GetCataloguesForProduct
- GetClientDescription
- GetClientName
- GetMenus
- GetProducts
- IsPortalDisabled
- IsPortalPrivate
- ProductDocRenderer
- ProviderUpstreamURL
- SplitStrings
- TruncateString
- TypeOfCredential
CanCreateOrganisation
Returns true if user can create an organization.Example Usage
Clients
Returns the list of applications for the current user. Expects the request as argument.Client Attributes
Accessible via{{ range $client := Clients req }}
Attribute | Description |
---|---|
{{ $client.ID }} | Client ID |
{{ $client.Name }} | Client name |
{{ $client.Description }} | Client description |
{{ $client.RedirectURLs }} | Client redirect URLs |
{{ $client.Credentials }} | Array of client credentials |
{{ $client.AccessRequests }} | Array of client access requests |
Credential Attributes (Within client)
Accessible via{{ range $cred := $client.Credentials }}
Attribute | Description |
---|---|
{{ $cred.ID }} | Credential ID |
{{ $cred.Credential }} | Credential |
{{ $cred.CredentialHash }} | Credential hash |
{{ $cred.OAuthClientID }} | OAuth client ID |
{{ $cred.OAuthClientSecret }} | OAuth client secret |
{{ $cred.Expires }} | Credential expiration |
{{ $cred.AccessRequestID }} | Access request ID associated with the credential |
Access Request Attributes (Within client)
Accessible via{{ range $acreq := $client.AccessRequests }}
Attribute | Description |
---|---|
{{ $acreq.ID }} | Access request ID |
{{ $acreq.Status }} | Access request status |
{{ $acreq.UserID }} | User ID associated with access request |
{{ $acreq.AuthType }} | Access request auth type |
{{ $acreq.DCREnabled }} | true if access request DCR enabled |
{{ $acreq.ProvisionImmediately }} | true if provisioned immediately is enabled |
{{ $acreq.CatalogueID }} | Catalogue ID |
Product Attributes (Within access request)
Accessible via{{ range $product := $acreq.Products }}
Attribute | Description |
---|---|
{{ $product.ID }} | Product ID |
{{ $product.Name }} | Product name |
{{ $product.DisplayName }} | Product display name |
{{ $product.Path }} | Product path |
{{ $product.Description }} | Product description |
{{ $product.Content }} | Product content |
{{ $product.AuthType }} | Product auth type |
{{ $product.DCREnabled }} | true if product DCR enabled |
Plan Attributes (Within access request)
Accessible via{{ $acreq.Plan }}
Attribute | Description |
---|---|
{{ .Name }} | Plan name |
{{ .DisplayName }} | Plan display name |
{{ .Description }} | Plan description |
{{ .AuthType }} | Plan auth type |
{{ .Rate }} | Plan rate |
{{ .Per }} | Plan period |
{{ .QuotaMax }} | Plan quota maximum |
{{ .QuotaRenewalRate }} | Plan quota renewal rate |
{{ .AutoApproveAccessRequests }} | true if auto-approve access requests is enabled |
Example Usage
CurrentUser
TheCurrentUser
function returns the current user object if a user is logged in. It expects the request as an argument.
User Attributes
Accessible via{{ $user := CurrentUser req }}
Attribute/Method | Description |
---|---|
{{ $user.ID }} | User ID |
{{ $user.First }} | User name |
{{ $user.Last }} | User surname |
{{ $user.Email }} | User email |
{{ $user.OrganisationID }} | User organization ID |
{{ $user.DisplayName }} | User complete name |
{{ $user.IdentityProvider }} | User provider (Portal or Tyk Identity Broker) |
{{ $user.GetOrganisationID }} | User’s organization ID |
{{ $user.IsAdmin }} | true if user is an admin |
{{ $user.IsOrgAdmin }} | true if user is an organization admin |
{{ $user.DisplayRole }} | User’s role |
Example Usage
FeaturedProducts
Returns a list of featured products.Product Attributes
Accessible via{{ range FeaturedProducts }}
Attribute | Description |
---|---|
{{ .ID }} | Product ID |
{{ .Name }} | Product name |
{{ .DisplayName }} | Product display name |
{{ .Path }} | Product path |
{{ .ReferenceID }} | Product reference ID |
{{ .Description }} | Product description |
{{ .AuthType }} | Product auth type |
{{ .Scopes }} | Product scopes |
{{ .Logo.URL }} | Product logo URL |
{{ .Feature }} | true if the product is featured |
{{ .DCREnabled }} | true if DCR is enabled |
{{ .ProviderID }} | Provider ID |
{{ .APIDetails }} | Array of API details associated with the product |
{{ .Catalogues }} | Array of catalogues associated with the product |
API Details Attributes (Within product)
Accessible via{{ range .APIDetails }}
Attribute | Description |
---|---|
{{ .Name }} | API name |
{{ .Description }} | API description |
{{ .APIType }} | API type |
{{ .TargetURL }} | API target URL |
{{ .ListenPath }} | API listen path |
{{ .OASUrl }} | API OAS URL |
{{ .Status }} | ”Active” if API status is active, otherwise “Inactive” |
Catalogue Attributes (Within product)
Accessible via{{ range .Catalogues }}
Attribute | Description |
---|---|
{{ .Name }} | Catalogue name |
{{ .VisibilityStatus }} | Catalogue visibility status |
FilterUserInvites
Returns a list of users that were invited to the current user’s organization, if the user became an organization. Expects the request as a parameter.User Attributes
Accessible via{{ range $invite := FilterUserInvites req }}
Attribute | Description |
---|---|
{{ $invite.ID }} | User ID |
{{ $invite.Email }} | User email |
{{ $invite.First }} | User first name |
{{ $invite.Last }} | User last name |
{{ $invite.Role }} | User role |
{{ $invite.JoinedAt }} | User joined at time |
{{ $invite.Joined }} | Whether the user has joined |
{{ $invite.Uactive }} | Whether the user is active |
FormatTime
Formats a given time with a given format.Example Usage
GetCart
Returns a map with the cart items for a given user ID. Expects the user ID as an argument. This function is useful for retrieving and displaying the contents of a user’s cart, including detailed information about the products, their authentication types, and associated templates.Cart Item Attributes
Accessible via{{ range $key, $value := GetCart $user.ID }}
Attribute | Description |
---|---|
{{ $value.AuthType }} | Cart item auth type |
{{ $value.Catalogue }} | Cart item catalogue |
{{ $value.DCREnabled }} | true if cart order consists of DCR products |
{{ $value.Plan }} | Cart item plan |
{{ $value.Products }} | Cart item array of products |
Plan Attributes (Within cart item)
Accessible via{{ $plan := $value.Plan }}
Attribute | Description |
---|---|
{{ .ID }} | Plan ID |
{{ .PlanName }} | Plan name |
{{ .FormatQuota }} | Formatted quota information |
{{ .FormatRateLimit }} | Formatted rate limit information |
Catalogue Attributes (Within cart item)
Accessible via{{ $catalogue := $value.Catalogue }}
Attribute | Description |
---|---|
{{ .ID }} | Catalogue ID |
Product Attributes (Within cart item)
Accessible via{{ range $product := $value.Products }}
Attribute | Description |
---|---|
{{ .ID }} | Product ID |
{{ .Name }} | Product name |
{{ .DisplayName }} | Product display name |
{{ .Path }} | Product path |
{{ .Description }} | Product description |
{{ .Content }} | Product content |
{{ .AuthType }} | Product auth type |
{{ .DCREnabled }} | true if product DCR enabled |
{{ .AuthTypes }} | List of product auth types |
DCR Client Template Attributes (Within product)
Accessible via{{ range $template := $product.Templates }}
Attribute | Description |
---|---|
{{ .ID }} | Template ID |
{{ .Name }} | Template name |
{{ .GrantType }} | Template grant type |
{{ .ResponseTypes }} | Template response types |
{{ .TokenEndpointAuthMethod }} | Template token endpoint auth method |
{{ .OktaAppType }} | Template Okta app type |
Example Usage
GetCatalogueList
Returns a list of catalogue names. Expects the request as parameter.Example Usage
GetCataloguesForProduct
Returns a list of products for a given user and product ID. Expects the request, a user and a product ID as parameters.Catalogue Attributes
Accessible via{{ range GetCataloguesForProduct req $user $product.ID }}
Attribute | Description |
---|---|
{{ .VisibilityStatus }} | Catalogue visibility status |
{{ .Name }} | Catalogue name |
Example Usage
GetClientDescription
Returns an application description given a credential ID.Example Usage
GetClientName
Returns an application name given a credential ID.Example Usage
GetMenus
Returns a map of all menus.Example Usage
GetProducts
Returns the list of products for the current user. Expects the request as an argument.Product Attributes
Accessible via{{ range $product := GetProducts req }}
Attribute | Description |
---|---|
{{ $product.ID }} | Product ID |
{{ $product.Name }} | Product name |
{{ $product.DisplayName }} | Product display name |
{{ $product.Path }} | Product path |
{{ $product.ReferenceID }} | Product reference ID |
{{ $product.Description }} | Product description |
{{ $product.AuthType }} | Product auth type |
{{ $product.Scopes }} | Product scopes |
{{ $product.Logo.URL }} | Product logo URL |
{{ $product.Feature }} | true if the product is featured |
{{ $product.DCREnabled }} | true if DCR is enabled |
{{ $product.ProviderID }} | Provider ID |
{{ $product.APIDetails }} | Array of API details associated with the product |
{{ $product.Catalogues }} | Array of catalogues associated with the product |
API Details Attributes (Within product)
Accessible via{{ range $api := $product.APIDetails }}
Attribute | Description |
---|---|
{{ $api.Name }} | API name |
{{ $api.Description }} | API description |
{{ $api.APIType }} | API type |
{{ $api.TargetURL }} | API target URL |
{{ $api.ListenPath }} | API listen path |
{{ $api.OASUrl }} | API OAS URL |
{{ $api.Status }} | ”Active” if API status is active, otherwise “Inactive” |
Catalogue Attributes (Within product)
Accessible via{{ range $catalogue := $product.Catalogues }}
Attribute | Description |
---|---|
{{ $catalogue.Name }} | Catalogue name |
{{ $catalogue.VisibilityStatus }} | Catalogue visibility status |
IsPortalDisabled
Returns true (exception: for admins is always enabled) if portal visibility was set to hidden. Expects the request as parameter.Example Usage
IsPortalPrivate
Returns true (exception: for admins is always enabled) if portal visibility was set to private. Expects the request as parameter.Example Usage
ProductDocRenderer
Returns the configured product OAS renderer (redoc or stoplight).Example Usage
ProviderUpstreamURL
Returns the provider upstream URL for a given providerID. Expects the request and a provider ID as parameters.Example Usage
SplitStrings
Splits a given string with given separator and returns a slice of split strings.Example Usage
TruncateString
Truncates a given string to a given length, returning the truncated string followed by three dots (…).Example Usage
TypeOfCredential
Returns the credential type (“oAuth2.0” or “authToken”) given the credential.Example Usage
Email Templates
This section provides a detailed overview of the email template data available in the Tyk Enterprise Developer Portal. The Tyk Enterprise Developer Portal uses a variety of email templates for different purposes, such as user registration and access request status or organization status updates. Each template has access to specific data or functions relevant to its purpose. It’s important to note that while email templates can include template data or specific template functions, they do not have access to the global helper functions available in other portal templates. Please refer to email workflow for additional detail on email notifications sent by the portal.Available Email Templates
- Access Request Approve/Reject
- Access Request Submitted
- Activate and Deactivate
- New User Request
- Organization Approve
- Organization Reject
- Organization Request
- Reset Password
- Targeted Invite
- Welcome User
Access Request Approve/Reject
Template Paths:themes/default/mailers/approve.tmpl
themes/default/mailers/reject.tmpl
Available Objects
There’s no data sent to these templates.Example Usage
Access Request Submitted
Template Path:themes/default/mailers/submitted.tmpl
This template is used for notifying administrators about pending access requests.
Available Objects
{{ .requests }}
: Returns the list of access requests pending approval.
Access Request Attributes
Accessible via{{ range .requests }}
Attribute | Description |
---|---|
{{ .PlanID }} | Plan ID associated with access request |
{{ .Status }} | Request status |
{{ .AuthType }} | Request authentication type |
{{ .UserID }} | User ID associated with the request |
{{ .ClientID }} | Client ID associated with the request |
{{ .DCREnabled }} | Indicates if DCR (Dynamic Client Registration) is enabled for the request |
{{ .ProvisionImmediately }} | Indicates if provisioning is immediate for the request |
{{ .CatalogueID }} | Catalogue ID associated with the request |
Product Attributes (within Access Request)
Accessible via{{ range $product := $acreq.Products }}
Attribute | Description |
---|---|
{{ $product.ID }} | Product ID |
{{ $product.Name }} | Product name |
{{ $product.DisplayName }} | Product display name |
{{ $product.Description }} | Product description |
{{ $product.AuthType }} | Product authentication type |
{{ $product.DCREnabled }} | Indicates if DCR (Dynamic Client Registration) is enabled for the product |
Example Usage
Activate and Deactivate
Template Paths:themes/default/mailers/activate.tmpl
themes/default/mailers/deactivate.tmpl
Available Objects
{{ .name }}
: Returns the user’s full name.
Example Usage
New User Request
Template Path:themes/default/mailers/newuser.tmpl
This template is used for notifying administrators about new user registration requests pending activation.
Available Objects
{{ .user }}
: Returns the new user pending activation.
User Attributes
Accessible via{{ .user }}
Attribute/Method | Description |
---|---|
{{ .ID }} | User ID |
{{ .First }} | User name |
{{ .Last }} | User surname |
{{ .Email }} | User email |
{{ .OrganisationID }} | User organization ID |
{{ .DisplayName }} | User complete name |
{{ .IdentityProvider }} | User provider (Portal or Tyk Identity Broker) |
{{ .GetOrganisationID }} | User’s organization ID |
{{ .IsAdmin }} | true if user is an admin |
{{ .IsOrgAdmin }} | true if user is an organization admin |
{{ .DisplayRole }} | User’s role |
{{ .Organisation.Name }} | Organization name |
{{ .Teams }} | Array of user teams |
{{ .Teams.ID }} | Team ID |
{{ .Teams.Name }} | Team name |
{{ .Teams.Default }} | Indicates if the team is the default team (true/false) |
Example Usage
Organization Approve
Template Path:themes/default/mailers/organisation_request.tmpl
This template is used for notifying users that their organization creation request has been approved.
Available Objects
{{ site }}
: Returns the application host.
Example Usage
Organization Reject
Template Path:themes/default/mailers/organisation_reject.tmpl
This template is used for notifying users that their organization creation request has been rejected.
Available Objects
There’s no data sent to this template.Example Usage
Organization Request
Template Path:themes/default/mailers/organisation_request.tmpl
This template is used for notifying administrators about new organization creation requests.
Available Objects
{{ .user }}
: Returns the user who made the request.{{ .organisationName }}
: Returns the new organization name.
User Attributes
Accessible via{{ .user }}
Attribute/Method | Description |
---|---|
{{ .ID }} | User ID |
{{ .First }} | User name |
{{ .Last }} | User surname |
{{ .Email }} | User email |
{{ .OrganisationID }} | User organization ID |
{{ .DisplayName }} | User complete name |
{{ .IdentityProvider }} | User provider (Portal or Tyk Identity Broker) |
{{ .GetOrganisationID }} | User’s organization ID |
{{ .IsAdmin }} | true if user is an admin |
{{ .IsOrgAdmin }} | true if user is an organization admin |
{{ .DisplayRole }} | User’s role |
Example Usage
Reset Password
Template Path:themes/default/mailers/auth/reset_password.tmpl
This template is used for sending password reset emails to users.
Available Functions
{{ current_user }}
: Returns the current user object.{{ reset_password_url }}
: Returns the URL with the token for setting the password.
User Attributes
Accessible via{{ current_user }}
Attribute/Method | Description |
---|---|
{{ .ID }} | User ID |
{{ .First }} | User name |
{{ .Last }} | User surname |
{{ .Email }} | User email |
{{ .Role }} | User role |
{{ .OrganisationID }} | User organization ID |
{{ .DisplayName }} | User complete name |
{{ .IdentityProvider }} | User provider (Portal or Tyk Identity Broker) |
{{ .GetOrganisationID }} | User’s organization ID |
{{ .IsAdmin }} | true if user is an admin |
{{ .IsOrgAdmin }} | true if user is an organization admin |
{{ .DisplayRole }} | User’s role |
Example Usage
Targeted Invite
Template Path:themes/default/mailers/auth/targeted_invite.tmpl
This template is used for sending targeted invitations to users.
Available Functions
{{ user }}
: Returns the targeted user object.{{ team }}
: Returns the team name to which the user is being invited.{{ invite_url }}
: Returns the URL with the token for setting the password.
User Attributes
Accessible via{{ user }}
Attribute/Method | Description |
---|---|
{{ .ID }} | User ID |
{{ .First }} | User name |
{{ .Last }} | User surname |
{{ .Email }} | User email |
{{ .Role }} | User role |
{{ .OrganisationID }} | User organization ID |
{{ .DisplayName }} | User complete name |
{{ .IdentityProvider }} | User provider (Portal or Tyk Identity Broker) |
{{ .GetOrganisationID }} | User’s organization ID |
{{ .IsAdmin }} | true if user is an admin |
{{ .IsOrgAdmin }} | true if user is an organization admin |
{{ .DisplayRole }} | User’s role |
Example Usage
Welcome User
Template Paths:themes/default/mailers/welcome_admin.tmpl
themes/default/mailers/welcome_dev.tmpl
Available Objects
{{ .user }}
: Returns the user who made the request. Refer to the CurrentUser section for accessible attributes and methods.
User Attributes
Accessible via{{ .user }}
Attribute/Method | Description |
---|---|
{{ .ID }} | User ID |
{{ .First }} | User name |
{{ .Last }} | User surname |
{{ .Email }} | User email |
{{ .OrganisationID }} | User organization ID |
{{ .DisplayName }} | User complete name |
{{ .IdentityProvider }} | User provider (Portal or Tyk Identity Broker) |
{{ .GetOrganisationID }} | User’s organization ID |
{{ .IsAdmin }} | true if user is an admin |
{{ .IsOrgAdmin }} | true if user is an organization admin |
{{ .DisplayRole }} | User’s role |
{{ .Organisation.Name }} | organization name |
{{ .Teams }} | Array of user teams |
{{ .Teams.ID }} | Team ID |
{{ .Teams.Name }} | Team name |
{{ .Teams.Default }} | Indicates if the team is the default team (true/false) |