Message template

From VYRE

Jump to: navigation, search

A message template is used send messages to website users as internal messages, or to website users and others via email. Messages can be sent due to direct user action, or at defined times, using a scheduler.

Contents

[edit] Creating and editing

Message template location
Message template location

Message templates can be found in the publishing module under Messages. A list of all existing message templates is display, along with their name, and type. New message templates can be created using the Create button in the top navigation, and exiting templates can be editing and deleted using the icons on the left side of the list. Note that once deleted a message template cannot be retrieved.

[edit] Message Template

Message template settings
Message template settings

The Message Template tab is used to configure the message template, based on the options chosen, different tabs and options will be available on save:

  • Title: The internal name for the message template, this is not displayed to the public at any point, and is used in other areas of Unify to reference it.
  • Type: Saving after selecting this option will open up new options.
    • Content related: Allow variables and recipients related to the item to be used.
    • User related: Allow variables related to the user to be used.
    • Static: Are used for all other purposes, but provide none of the variables or recipients the others do, but have the advantage they do not rely on an existing item or user, so can be triggered directly from the message template, using the Send option in the top naviagation.
  • Content Store: Only appears for content related message templates, specifies which store items will be which will trigger it belong to.
  • User Realm: Only appears for user related messages, specifies from which realm users will trigger it.
  • Subject: The subject for the message to be sent. This can contain variables.
  • Sender name: The name the message will be appear to have been sent from. This can contain variables.
  • Sender address: The address the message will appear to have been sent from. This can contain variables.
  • Send HTML: Flags whether the message should be sent as plain text or HTML. If unticked it will send plain text and ignore the HTML body, if ticked it will send as HTML and ignore the plain text message.
  • Plain text message: The contents of the message if it is to be sent as plain text. This can contain variables.
  • HTML body: The contents of the message if it is to be sent as HTML. The WYSIWYG editor can be used generate HTML without having to code it. This can contain variables.

[edit] Recipients

For each message template recipients are defined, various different types are possible, depending on what type of message is being sent. Current recipients can be viewed, edited and deleted in the Recipients tab, clicking on Add recipient option in the top navigation creates a new recipient.

[edit] Creating

When selecting to add a recipient a list of different types is displayed. Some of these only display for certain types of message templates. Once added there may be further edit options.

The first screen displays three options:

  • Title: An internal reference to the recipient.
  • Type: What type of recipient is being sent the message:
    • Static user group: A user group.
    • Dynamic user group: A group of users based on a profile group.
    • Current user: The user who triggered the message, either through an item or user portlet (only for content and user related messages).
    • Email address: A static email address, not a user in system. This message will not be sent to a user inbox.
    • Linked users: A user linked to the item (only for content related messages).
    • Item e-mail attribute: An attribute from the store which has been set to contain an email address (only for content related messages). This message will not be sent to a user inbox.
    • Translation group: A translation group (only for content related messages).
  • User Realm: This chooses the realm which the user being sent the message belongs to (not for static email addresses).

[edit] Editing

When creating a recipient, or editing them at a later point, there may be more options depending on the type:

[edit] Static user group
  • Static user group: The group to which send messages.
[edit] Dynamic user group
  • Dynamic user group: The profile group to which send messages.
[edit] Email address
  • Email address: An email address to send messages to.
[edit] Linked users
  • Link path: A user linked to the current item, or to a linked item can be configured, by adding stores, linked users or item creators or modifiers.
[edit] Item e-mail attribute
  • E-mail attributes: An attribute which will contain an email address the message can be sent to.
[edit] Translation group
  • Translation group: A group of users, used in translation of items, to send a message to.

[edit] Editing recipients

[edit] Linked users/items

If the message template is content related the linked users/items tab will appear. This allows linked users and items to be used in the message. The tab displays a list of all linked lists already set up, these can be edited and deleted.

[edit] Creating

Clicking Add linked list will allow a new list of linked users or items to be created. The following options need to be chosen:

  • Variable name: This will be used in the message.
  • Type: A choice of four types:
    • Item link: Items linked to the item the message is being sent for.
    • User link: Users linked to the item the message is being sent for.
    • Item creator: The user who created the item.
    • Item last modifier: The user who last modified the item.

Depending on the option chosen, different secondary options will appear:

[edit] Item link properties

For linked lists of items:

  • Link Definitions: For which link definition to display linked items.
  • Extensible Stylesheet Language (XSL) File: Which XSL to use to render the XML returned. The XML will have the same form as that returned by the item search results portlet.
  • Load items that are linked to the items in the list: Loads linked items to the linked items into the XML.
  • Load users that are linked to the items in the list: Loads linked users to the linked items into the XML.
  • Load the content and metadata of items that are linked to the items in the list: Loads the full set of attributes of items to the linked items into the XML. This will only work if the linked items to the linked items are selected to be returned.
[edit] User link properties

For linked list of users:

  • User Link Definitions: For which link definition to display linked users.
  • Extensible Stylesheet Language (XSL) File: Which XSL to use to render the XML returned. The XML will have the same form as that returned by the user list portlet.

For item creator and modifier:

  • Extensible Stylesheet Language (XSL) File: Which XSL to use to render the XML returned. The XML will have the same form as that returned by the user display portlet.

[edit] Usage

Having set up a linked list, and formatted it using XSL, it can be used in the message body, subject, sender name and sender address by using the variable name that was set up, for example $linkedItems in the message body.

[edit] Variables

The variables tab contains a list of variables which can be used in the message body, subject, sender name and sender address. These variables change depending on the type of message, for example content related messages will have variables containing information about the content item the message is being sent for, its creator and last modifier. A user related message will have variables containing information about the user. Any recipients added to the message may also add variables, for example once a recipient is added the recipient name can be used in the html body, for example starting the email with Dear $lr_123_fullname.

[edit] Triggering messages

[edit] Item portlets

Messages can be triggered by editing items. Depending on whether an item is created, edited or deleted a different message can be sent.

[edit] Item edit portlet

Main article: item edit portlet

In an item edit portlet a message template can be selected to be sent when an item is saved (created or edited), or when an item is deleted. Ticking the checkbox next to the appropriate option in the portlets edit mode will trigger a message to be sent when the action occurs, with the message templates to select being chosen from all content related message templates assigned to the same store as the portlet.

[edit] Item edit using template portlet

Message settings access via portlet
Message settings access via portlet
[edit] Portlet settings

Item edit using templates portlets have the similar options to the item edit portlet, but with the difference that there are seperate options for creating and editing items, where seperate message templates can be defined for each action, or messages sent on only one of them.

[edit] Content template
Main article: Content template

From version 4.4 it will be possible to define message templates to be used in the content template rather than just in the portlet. This will allow a much more fine-grained approach, with the correct use of JSTL allowing for choices or multiple messages to be sent depending on item attributes or user actions.

[edit] User portlets

Both the user create portlet and the user edit portlet have the same options. The only difference is that the user create portlet sends the message when a new user is created, and the user edit portlet when the user is edited. Both portlets will only allow user related message templates to be selected.

There is a checkbox Send message on submit which specifies if messages will be sent when the user is being created/edited. The first dropdown displays selects a message template to be sent to the user who has been created/edited, and will pass their information as to the message template as the current user which can be used by variables in the text, and as a recipient. This for example could be used to send a creation confirmation message.

The second dropdown lists a message template which can be sent to another user, or multiple users. This for example could be used to inform an administrator that a user account has been created.

[edit] Schedulers

Main article: scheduler

Schedulers can be used to send a message at a specific time, rather than due to a user action. Items returned from a saved search, or users in a profile group will trigger a message or messages to be sent. This could for example be used to sent an email for all items due to be published in the next day. Another example would be to send all users who have not logged in, in the last 6 months, a reminder.

[edit] Sending Messages

Messages will always be sent to the user's internal inbox, which can be viewed in the Unify backend in the my desktop module, and on sites using the user inbox portlet.

The second option is sending messages by email. If the user profile has the Receive email checkbox checked they will receive any messages by email as well as the inbox. This option can be set when a user is created using user create portlet or when editing a user through user edit portlet. In the backend there is also an option on the user profile in the users and groups module.

Personal tools