This class allows the client-side script to execute the code on the server-side usingScript Includes. it is used to simply create branded notifications.
property {string} title - Main header of notification {string} bodyHeader - Header of text body {string} bodyText - Main text area {string} comment - Comment wraps in area with grey background, also becomes italic {array} buttons - Array of buttons (better generate via addButton())
setTitle(title)
Supposed initialising with specified title @param {string} title - Main header of notification */
setBodyHeader(bodyHeader)
This method sets header of text body of email notification * @param {string} bodyHeader - Header of text body
Parameter(s):
Name
Type
Mandatory
Default value
bodyHeader
String
Y
N
Return:
Type
Description
Void
This method does not return a value.
setBodyText(bodyText)
Sets main text body of email notification @param {string} bodyText - Main text body
Parameter(s):
Name
Type
Mandatory
Default value
bodyHeader
String
Y
N
Return:
Type
Description
Void
This method does not return a value.
setComment(comment)
Sets comment of email notification (after wraps in an area with a grey background, also becomes italic) @param {string} comment - Comment text
Parameter(s):
Name
Type
Mandatory
Default value
bodyHeader
String
Y
N
Return:
Type
Description
Void
This method does not return a value.
getTitle(title)
This method returns the main header of notification.
Return:
Type
Description
String
The main header of notification.
getBodyHeader(bodyHeader)
This method returns the main header of text body.
Return:
Type
Description
String
The main header of text body.
getBodyText(bodyText)
This method returns the main text body.
Return:
Type
Description
String
The main text body.
getComment(comment)
This method returns the comment text.
Return:
Type
Description
String
The comment text.
getButtons(buttons)
This method returns the array of buttons.
Return:
Type
Description
Array
The array of buttons.
addButton(button)
This methods adds a new button to array of buttons. Parameter(s):
Name
Type
Mandatory
Default value
text
String
Y
N
url
String
Y
N
color
String
Y
N
buttonArray
Array
Y
N
Return:
Type
Description
Array
The base of buttons array with the new one.
removeButton(button)
This method removes the last added button.
removeAllButtons(buttons)
This method removes all added buttons.
setProperty(propertyName, input, propertyTitle)
This method internal method for input type validation * @param {string} propertyName - Name of property to validate * @param {any} input - Given input from 'Set' methods * @param {string} propertyTitle - Title of property for error text Parameter(s):
Name
Type
Mandatory
Default value
propertyName
String
Y
N
input
Any
Y
N
propertyTitle
String
Y
N
formEmailTemplate()
This method creates and returns HTML template based on set properties.