Book Contents

Book Index

Administration and settings

Book Contents

Book Index

Web and e-shop - General settings
Registrations settings

In this section, we define the statuses in which a user registration on the e-shop can be in the Registration book.

pic_4324_2024

Picture: Registrations settings

Recalculation settings

Here we specify whether the recalculations are to be calculated only for registered users.

pic_4325_2024

Picture: Settings of article recalculation

Email sending settings

On the Email sending settings tab, we set the number of sending attempts and the delay between attempts if the SMTP server fails to send an e-mail from the web/e-shop. Here we can also set the validity time of the GUID for a forgotten password. The default is 30 minutes.

pic_4326_202509

Picture: Email sending settings

Send news and special offers

In this section, we define the statuses in which various records can be.

pic_4327_2024

Picture: Send news and special offers

URL address settings

The option to regenerate friendly URL addresses is offered by the general web and e-shop settings, where the displayed form contains the URL address settings option. To run it, it is necessary to check the Use clean URL field, which regenerates the existing URL addresses while their indexing in search engines remains at the current position. After the conversion, a file is displayed that filters the pages for which the URL addresses are not unique, and the administrator can set them in the given modules according to their own needs, also in other languages.

When the Clean URL with nesting option is checked, the clean URL will be displayed on the web with the structure (nesting) preserved.

pic_5716_2024

Picture: URL address settings

Book Contents

Book Index

Email templates book

The Email templates book is used to create and manage e-mail templates that are used for automatic sending of e-mails on various events (e.g. order confirmation, user registration or password reset).

The book is available in the tree menu Web e-shop / Administration and settings / Email templates.

pic_4143_202506

Picture: Book - Email templates

Use of e-mail templates:

In the K2 system, the user defines for which action a specific template is to be used. The linking of the template with the process itself is ensured by the system or created as part of the implementation.

The book records all created e-mail templates, which can be edited at any time according to current needs. The standard e-mail templates supplied with the K2 system can be imported in bulk using the script "ImportWysiwygEmailTemplates.pas". The script description is given in the Script catalogue, see Import of email templates.

Book Contents

Book Index

Email templates - Basic data

On the Basic data tab, we must define the action on which the e-mail will be sent and the formats for the template definition. We can also set the conditions under which the template is to be used.

pic_1703430

Picture: Email templates book - Basic data

Description of fields:

Description

A clearer specification of what the template will be used for.

Action

The action for which the template will be used, e.g. registration confirmation, forgotten password, order confirmation.

If we already have the action created, we select it from the list. If not, we create a new action in the Action data module using the Insert key or the New button. When creating a new action, it is necessary to define:

  • the Data module on which the action will be run (e.g. the Sales Orders module for confirming an order from the e-shop),
  • optionally an Abbreviation and a Description for better orientation,
  • the RID field is filled in automatically.

pic_4852

Picture: Action - list of existing actions

pic_4853

Picture: Action - new action

Data module

The data module from which information is loaded into the template. It is filled in automatically after the Action is entered.

Blocked

Option to block the template and thus prevent its use

Filter conditions

Using the Filter conditions button, it is possible to define under which conditions the given template is to be used. This allows:

  • using multiple variants of one template,
  • sending e-mails only when specific conditions are met (e.g. to a specific customer or for a certain e-shop).

Sender, Name of sender, Copy, Hidden copy

Fields for sending. Here we can specify the name of the sender and to whom a copy or a hidden copy is to be sent.

Subject format,

Text format

Field for specifying the format of the subject and body of the e-mail. Variants:

  • No format - the e-mail is sent as plain text.
  • XSL stencil - in the e-mail, it is possible to refer to fields located in K2, e.g. the name of the Contact person from the Sales order, etc. The XSL stencil is a more advanced variant of K2 formatting.
  • K2 formatting - in the e-mail, it is possible to refer to fields located in K2, e.g. the name of the Contact person from the Sales order, etc.
  • K2 formatting (WYSIWYG) - a visual editor for easy creation of templates. It supports:
    • text formatting (paragraphs, colours, numbered and bulleted lists),
    • inserting pictures and hyperlinks,
    • selecting data fields without the need to write them manually,
    • the option to switch the language,
    • the advantage is an immediate preview of the resulting appearance.

Required fields

We use Required fields if we refer to some of the fields in K2. This area is intended to help specify the fields from the given module that are to be used in the e-mail, so that the created file is not too large.

Note: used only when the K2 formatting or XSL stencil format is selected.

Message in HTML format

Option whether the e-mail body is in HTML

Book Contents

Book Index

Email templates - Template definition

On the Template definition tab, we create the specific content of the e-mail, which is then sent to the recipients. Here we define:

pic_1073240

Picture: Email templates - Template definition tab

Both templates can be defined for different language versions. Languages are switched using the button with a globe icon and the language name. By default, the default language pic_971i is set.

If we selected K2 formatting on the Basic data tab, it is possible to insert values from data fields into the template. A field reference is written in curly brackets, e.g. {ContactPersonId.Surname}. This notation fills the surname of the contact person from the corresponding record into the e-mail.

Working with WYSIWYG formatting is described in more detail in the chapter K2 formatting wysiwyg.

Book Contents

Book Index

Email templates - Email attachments

On the Email attachments tab, it is possible to define files that will be attached to the sent e-mail. A new attachment is created with the Insert key or the New button in the window header.

pic_4855

Picture: Email templates book - Email attachments - new attachment

After opening the form, it is necessary to select the Type of supplement:

Book Contents

Book Index

Email templates - External Documents and Documents

On the External Documents and Documents tab, it is possible to insert files that are to be displayed in the e-mail, for example pictures or documents.

A new attachment is created with the Insert key or the New button in the window header. After opening the form, it is possible to select from documents that are already stored in the K2 system (e.g. article pictures or other attachments).

Book Contents

Book Index

Template preview

The preview of the created template is displayed with the E-mail template preview button in the ribbon. The button is available only after the template is saved.

After selecting the language and a specific record, the E-mail message form is displayed with a preview of the e-mail including the filled-in data.

pic_1703253

Picture: E-mail template preview

pic_1703254

Picture: Email message with the email template preview

The e-mail template preview can be:

For these functions, the following buttons must be added to the ribbon of the E-mail message form:

The buttons are added to the form as follows:

  1. We open the E-mail message window using the E-mail template preview function.
  2. In the ribbon, we press the right mouse button and select the Customize the ribbon for the current user option.
  3. In the "Choose commands from…" tree menu, we select the E-mail message. item
  4. From the list of commands, we select the command "Export to EML" or "Open in default browser".
  5. We add the selected command to the ribbon and save the changes.

pic_1703255

Picture: Exported email template preview in Outlook

K2 formatting wysiwyg

In the Email templates module, it is possible to format text using the K2 WYSIWYG editor. When creating a new template, it is enough to select the "K2 formatting WYSIWYG" option in the Text format field in the basic data and then use the editor to create the e-mail content.

The advantage of the editor is that we see the result directly while editing, including all graphic elements, without the need to export. The editor makes writing and editing templates easier, offers field search, selection of formatting and the option to change the environment language.

It supports common text operations – paragraph formatting, changing colours, indentation, numbered and bulleted lists, inserting pictures and hyperlinks. Using the editor is intuitive and can be handled by anyone who has ever worked with a text editor.

At the bottom of the editor there is a toolbar where you can change the language environment, turn the display of tags and structure on or off, switch to the structure change mode or display the HTML source code, which can be edited or copied directly.

pic_1703259

Picture: Toolbar

When the Change structure function is on, new rows (above and below) or columns (left or right) can be inserted in the editing field using the right mouse button. After selecting the required cells, it is also possible to use the function to merge them. Thanks to these tools, the structure of the entire template can be fully modified.

Meaning of the buttons in the toolbar:

pic_977i

Back

Used if we want to go one step back.

pic_978i

Forward

Used if we want to move one step forward.

pic_1145i

Arial

Option to select the font; the Arial, Verdana, Georgia and Times New Roman styles are supported.

pic_979i

Pen style

Used to change the heading style. The user has several levels as well as normal text available.

pic_980i

Font size

Changes the font size. The user changes the size using a slider. Moving to the right enlarges the font, moving to the left reduces it.

pic_981i

Text colour

Changes the text colour. The user has a colour palette available from which they can select predefined colours.

pic_982i

Remove formatting

Removes all formats that have been set (e.g. font size or text colour). Returns the text to its original form.

pic_983i

Bold

The selected text is converted to bold.

pic_984i

Italics

The selected text is converted to italics.

pic_985i

Underline

The selected text is underlined.

pic_986i

Strikethrough

The selected text is struck through.

pic_987i

Picture

Allows selecting and attaching a picture. It can only be attached as a URL path to the picture.

pic_990i

Align left

The selected text is aligned to the left. If we click into a cell, the text in the entire cell is aligned.

pic_991i

Align centre

The selected text is aligned to the centre. If we click into a cell, the text in the entire cell is aligned.

pic_992i

Align right

The selected text is aligned to the right. If we click into a cell, the text in the entire cell is aligned.

pic_1382i

Line spacing

Option to set the line spacing for the entire cell.

pic_993i

Numbered list

The selected text is converted to a numbered list. Each paragraph will be marked with a sequence number.

pic_994i

List

The selected text is converted to a list. Each paragraph will be marked with a predefined bullet.

pic_997i

Link

A link is added to the selected text via a URL address, which must be entered in the absolute Url field. Absolute URL means any web page (e.g. http://www.k2.cz or https://www.k2.cz). When creating a link, the user can also choose to create a button and select its colour. Using the plus symbol, a variable can also be inserted as the URL.

pic_1146i

Add

Offers the option to insert a field, items or a condition.

pic_1155i

Background colour

Changes the background colour. The user has a colour palette available from which they can select predefined colours.

Meaning of the buttons in the toolbar in the "Change structure" mode:

pic_977i

Back

Used if we want to go one step back.

pic_978i

Forward

Used if we want to move one step forward.

pic_1147i

Left border

Adds a border on the left side of the selection.

pic_1148i

Right border

Adds a border on the right side of the selection.

pic_1149i

Bottom border

Adds a border on the bottom side of the selection.

pic_1150i

Top border

Adds a border on the top side of the selection.

pic_1151i

No border

Removes all borders.

pic_990i

Align left

The selected text is aligned to the left.

pic_991i

Align centre

The selected text is aligned to the centre.

pic_992i

Align right

The selected text is aligned to the right.

pic_1152i

Align top

Allows aligning the text to the top edge.

pic_1153i

Align middle

Allows aligning the text to the middle between the top and bottom edges.

pic_1154i

Align bottom

Allows aligning the text to the bottom edge.

Book Contents

Book Index

Wysiwyg examples
Example No. 1 - Creating a table with sale items

In the "Order confirmation" e-mail, we want to display a table with the list of purchased articles (sale items on the sales order).

  1. We press the pic_1146i button and select the "Insert items" option from the menu.
  2. In the field selection, we search for "Sale Items" and insert the sale items into the template with the Select button.
  3. We switch to the Change structure mode.
  4. In the "Inserted items" cell, we press the right mouse button and select the Insert cell right/left. option. In this way, we create as many cells as the number of table columns we need.
  5. Then, by right-clicking any "Inserted items" cell, we select the Insert row above. option. This creates the table header.
  6. We turn off the Change structure mode and write the column names in the table header.
  7. Using the pic_1146ibutton, we insert data fields (e.g. ArticleId.Abbr, EshopArticleNameCalc, QuantityUMCalc) into the corresponding cells (columns) of the Sale Items.

Example No. 2 - Adding a condition to a field

In the "Order confirmation" e-mail, we want the article name to be displayed in black if it is a classic article card and in blue if it is an article of the Set type.

If we want to display a field in different colours under different conditions, we must enter the data field as many times as there are display variants and set a condition for each field specifying when it is to be displayed in the e-mail.

  1. In the Sale Items cell in the Name column, we insert the ArticleId.Abbr field twice.
  2. We leave one field black and change the colour of the other to blue.
  3. We select the first (black) field, press the buttonpic_1146iand select the "Insert condition", option from the menu, where we fill in the condition parameters. Then we select the second (blue) field, again press the buttonpic_1146i, select the "Insert condition" option from the menu and define the condition for the Set article type:

pic_1703257

Picture: Condition definition - type NOT EQUAL to Set (black field)

pic_1703258

Picture: Condition definition - type EQUAL to Set (blue field)

The created table with the defined conditions looks as follows:

pic_1073240

Picture: E-mail template definition - Order confirmation

pic_1073238

Picture: E-mail - Order receipt confirmation

Book Contents

Book Index

Overview of tables, reports, scripts and other functions
Tables in K2
Reports
Scripts
K2 functions

Note: For security reasons, it is not possible to run recalculations concurrently or together with the Shift+F3 function. K2 monitors this concurrency. If a similar action is run by a special script, it is necessary to first verify whether the action is possible - the function HoldShopRecalc(var AUser: String; ACheckOnly: Boolean = False): Boolean exists on TD_Zbo, TD_esCategoryInfo and TD_esShop. It is also possible to prohibit running recalculations by a script with this function; after the action is performed, the recalculations must be enabled again with the UnHoldShopRecalc function.

Note: Running of recalculations is recorded through error logs of type 19.

- Configure picture link storage - sets the path for storing links from the External Documents and Documents tab - the Links tab, as well as access to the FTP storage.

- Orders from the e-shop - displays a preview of the XML file created after the order is submitted.

Book Contents

Book Index

User rights for web and e-shop

In the User roles - User rights - Rights module, it is possible to set user rights for the Web and e-shop module.

pic_4593

Picture: Rights definition for Web and e-shop