Fluent builder for creating a new Alert, obtained from AlertsManager.newAlertBuilder. Set the properties for the alert using the builder methods and call build to save it and return the created Alert.
Group: Builders
Methods
name(String alertName) · title(String alerTitle) · website(Website alertWebsite) · targetOrg(Organisation alertTargetOrg) · targetGroup(Group alertTargetGroup) · targetOrgType(OrgType alertTargetOrgType) · body(String alertBody) · type(String alertType) · position(String alertPosition) · allowDismiss(boolean alertAllowDismiss) · startDate(Date alertStartDate) · control(String controlName) · build()
name(String alertName)
Returns: AlertBuilder
Sets the alert's name.
| Parameter | Description |
|---|---|
alertName | the alert's name |
title(String alerTitle)
Returns: AlertBuilder
Sets the alert's title, shown above its body.
| Parameter | Description |
|---|---|
alerTitle | the alert's title |
website(Website alertWebsite)
Returns: AlertBuilder
Sets the website the alert is shown on.
| Parameter | Description |
|---|---|
alertWebsite | the website to associate the alert with |
targetOrg(Organisation alertTargetOrg)
Returns: AlertBuilder
Restricts the alert to profiles who belong to this organisation.
| Parameter | Description |
|---|---|
alertTargetOrg | the organisation to target |
targetGroup(Group alertTargetGroup)
Returns: AlertBuilder
Restricts the alert to profiles who belong to this group.
| Parameter | Description |
|---|---|
alertTargetGroup | the group to target |
targetOrgType(OrgType alertTargetOrgType)
Returns: AlertBuilder
Restricts the alert to people who belong to an organisation of this type. ANDs with targetGroup and targetOrg.
| Parameter | Description |
|---|---|
alertTargetOrgType | the organisation type to target |
body(String alertBody)
Returns: AlertBuilder
Sets the alert's body text, which may contain merge field placeholders evaluated when the alert is displayed.
| Parameter | Description |
|---|---|
alertBody | the alert's body text |
type(String alertType)
Returns: AlertBuilder
Sets the alert's visual style. Ignored if the given value is not one of the recognised types.
| Parameter | Description |
|---|---|
alertType | the alert type - one of warning, info, primary, danger, success or modal popup |
position(String alertPosition)
Returns: AlertBuilder
Sets where the alert is displayed on the page. Ignored if the given value is not one of the recognised positions.
| Parameter | Description |
|---|---|
alertPosition | the alert position - top or bottom |
allowDismiss(boolean alertAllowDismiss)
Returns: AlertBuilder
If true, users can dismiss the alert; if false, it stays visible while active.
| Parameter | Description |
|---|---|
alertAllowDismiss | whether users may dismiss the alert |
startDate(Date alertStartDate)
Returns: AlertBuilder
Sets the date from which the alert becomes active.
| Parameter | Description |
|---|---|
alertStartDate | the alert's start date |
control(String controlName)
Returns: AlertBuilder
Sets the control code for this alert, looked up by name.
| Parameter | Description |
|---|---|
controlName | the name of the control to use |
build()
Returns: Alert
Saves the alert to the current admin organisation using the properties set on this builder, and returns the persisted alert.