Skip to main content

Email sending

In this path, you will learn how to build a lis of clients with the function of sending emails to them. The example shows the configuration of the group sending action (to many recipients) and the sending action to a specific addressee.

Below is the material presenting the resulting functionality.

Issues presented in the current article​

DATA STRUCTURE

  1. Building a data structure
  2. Adding fields to a data structure
  3. Importing data using an SQL script (database panel)

LIST

  1. Building a list
  2. List properties
  3. Actions on the list

PACKAGE

  1. Random Data Generator block
  2. Map In Place block
  3. Split Way block
  4. Merge Way block
  5. Send e-mail block
  6. Request block
  7. Response block
  8. Publishing a package

OTHER

  1. SMTP server configuration
  2. Invoking services

STEP 1 - DATA STRUCTURE AND LIST​

In this step:

  1. You will create a data structure of product
  2. Based on the data structure You will create a list of products
  3. You will use a SQL query to fill data into the list

Sample script with data import:

INSERT INTO [dbo].[CLIENT] ([C\_NAME], [C\_SURNAME], [C\_EMAIL], [C\_AGE])
VALUES ('John', 'Smith', 'john.smith@home.com', 34)
INSERT INTO [dbo].[CLIENT] ([C\_NAME], [C\_SURNAME], [C\_EMAIL], [C\_AGE])
VALUES ('Adam', 'Kruger', 'adam.kruger@office.eu', 33)
INSERT INTO [dbo].[CLIENT] ([C\_NAME], [C\_SURNAME], [C\_EMAIL], [C\_AGE])
VALUES ('Danny', 'Kogh', 'danny.kogh@studio.com', 42)
INSERT INTO [dbo].[CLIENT] ([C\_NAME], [C\_SURNAME], [C\_EMAIL], [C\_AGE])
VALUES ('Ruth', 'Barber', 'ruth@barbershop.com', 35)
INSERT INTO [dbo].[CLIENT] ([C\_NAME], [C\_SURNAME], [C\_EMAIL], [C\_AGE])
VALUES ('Steven', 'Vilson', 'steven.vilson@r56.com', 63)

STEP 2 - SMTP CONFIGURATION​

In this step:

  1. You will display the configuration parameters using the database panel
  2. You will complete the above parameters using an SQL script, in accordance with the configuration of the SMTP server from which you want to send e-mails.

List of SMTP configuration parameters:

common.param.smtp_ignore_certificate_errors
common.param.smtp_password
common.param.smtp_port
common.param.smtp_server
common.param.smtp_username
common.param.smtp_security

Sample configuration script:

UPDATE dbo.CONFIG_KEYS
SET CK_VALUE = 'your_value' WHERE CK_KEY = 'common.param.smtp_ignore_certificate_errors' UPDATE dbo.CONFIG_KEYS
SET CK_VALUE = 'your_value' WHERE CK_KEY = 'common.param.smtp_password' UPDATE dbo.CONFIG_KEYS
SET CK_VALUE = 'your_value' WHERE CK_KEY = 'common.param.smtp_port' UPDATE dbo.CONFIG_KEYS
SET CK_VALUE = 'your_value' WHERE CK_KEY = 'common.param.smtp_server' UPDATE dbo.CONFIG_KEYS
SET CK_VALUE = 'your_value' WHERE CK_KEY = 'common.param.smtp_username' UPDATE dbo.CONFIG_KEYS
SET CK_VALUE = 'your_value' WHERE CK_KEY = 'common.param.smtp_security'
warning

In the examples, text values are enclosed in apostrophes ('your_value'). If a configuration value needs to be cleared and set to NULL, use NULL without apostrophes. Otherwise, the text "NULL" will be saved to the database instead of the NULL value.

STEP 3 - MAILING PACKAGE​

In this step:

  1. You will create an e-mail delivery package in two ways (collective mailing and mailing to a single recipient)
  2. You will use blocks (Random Data Generator, Split Way, Map In Place, Merge Way, Send Email)
  3. You will send a test message using the prepared package
  4. You modify the package and publish it (blocks: Request and Response)

STEP 4 - CALLING PACKAGE FROM LIST ACTION​

In this step:

  1. You will create a workflow with which to invoke the e-mail sending service
  2. You will create two actions on the list: a collective action "send to all" and an action on the record "send to client"