Learn the steps to configure a scheduled task to automatically import contacts into your database.
Creation
Go to the "Settings" menu and click on "Scheduled tasks".
You will see the page with the list of scheduled tasks, which will be empty upon your first access.
Click the "New task" button in the top right corner and define:
- Task name
- Context: Database
- Database: select the target database for the import task
- Task type: Automatic contact import
Then click the "Save" button.
After creating the task, you will be directed to the first step section of the setup, called "Settings," where you will configure the general settings of the task.
On the right, you will find the "Task" menu that will guide you through all the setup steps:
- Settings
- Data source
- File parameters
- Contact fields
- Import rules
- Report of the processed file
- Ending
Setup
In this section, you define the general settings of your task. Refer to the article How to create a scheduled task: general settings for details.
Data source
This section is where you configure all the options related to the data file import.
Type of data source:
-
File from local FTP
The execution will fetch the file from the account's local FTP. To access this section, go to the menu "Settings," then "FTP" and "Browse files".
In this section, you can create new folders and upload files.
FTP remote server: The file will be fetched from a non-resident FTP on the platform. To configure this service, go to the "Settings" menu, then "FTP" and "Remote FTP".
On the appearing page, select the "New server" button and configure all the parameters for your remote FTP. Once your FTP service is set up, return to the configuration section of your task and define the folder from which the file will be obtained.
Once you have configured your FTP, set:
- Folder: the folder from which to retrieve the file containing the data to import.
- Folder of processed file: the folder where processed files will be moved at the end of the execution.
- File extension: all files with the specified extension (e.g., by specifying the value ".csv", all files with this extension will be imported).
- Order of choice: when there are multiple files in the same folder, the platform will apply the chosen criterion to decide which file to process first.
- File extension after processing: once the file has been processed, the platform will add the specified extension to the file name to mark it as processed.
File parameters
Define the characteristics of the file you have prepared for import:
With the options:
You can:
- Remove unnecessary spaces at the beginning and end of the file you are creating
If a field, for example, instead of starting with an alphanumeric character, begins with one or more spaces, these will be automatically removed. The same operation will then be applied to any spaces present after the last character - Compress the file in .zip format
- Insert column headers in the first row
Sandbox: it is the function that allows you to test a trial file without updating the DB.
- Upload a sample file by clicking the Upload a sample file button.
- Once uploaded, test it using the Test settings function.
Contact fields
To proceed with the import, it is necessary that magnews database fields match the fields in the file to import.
Match each column in the file to the corresponding field in the magnews database.
You can test the configuration by selecting the button "Test settings (contacts will not be updated)".
Import rules
You can set some additional parameters to further optimize the automated import.
Security rules on the imported file
In this section, you can define:
- Maximum percentage of accepted errors: indicates the maximum acceptable error limit for the import. The execution will be stopped once the set percentage is reached.
- Minimum number of valid rows: indicates the minimum level of valid records for each file below which the import will not be considered acceptable and the execution will be stopped.
- Maximum number of rows to import: this option limits the maximum number of contacts that can be imported for each single execution.
And possibly decide whether to:
- disable the error reporting if no file is available at the time of task execution.
- disable sending a notification email if no file is available at the time of task execution.
- schedule a new execution to process additional files available after completing the import of the first file.
Options
In the "Options" you can define:
- Type of import: choose whether to import contacts into the database with "Subscribed" or "Unsubscribed" status.
- Source: define the value that the "Source" field will have in the database. By default, there are three values: “Self subscribed from web”, "Added from the account" and "Imported from file", but you can add others by modifying the "Source" field.
-
For contacts: define what to do with the contacts to be added in an already populated database:
-
-
- import new contacts and update existing contacts;
- import only new contacts;
- update only existing contacts.
-
-
It is possible to allow the re-subscription of unsubscribed contacts and update the status of subscribed contacts based on the content of the file.
-
Empty fields:
If a field is populated on the platform and empty on the file to be imported, you can choose to clear the fields on the database as opposed to not updating already populated fields (thus leaving the database values unchanged in this second case). -
Mobile numbers import:
- With Strict mobile numbers validation, you will import only correctly formatted mobile numbers:
-
- with a valid international prefix;
- without spaces;
- without characters other than numbers or the +/- signs
- E.g. +390544123456789: correctly formatted phone number;
+39 0544 123456789: incorrectly formatted number.
-
- Through Phone numbers automatic recovery, it is possible to automatically add the international prefix to all imported phone numbers.
- With Strict mobile numbers validation, you will import only correctly formatted mobile numbers:
Add to audience
Select this option if you want to import contacts into a static audience. You can also indicate whether to delete the static audience after a certain number of days.
Blacklist
For imported contacts with a delivery inserted in Blacklist, you can choose to unsubscribe them or suspend them.
Complete database update
Select this option if you want to completely replace the contacts present in your database with those in the file. Contacts present in the database but not in the file will be unsubscribed.
You can also configure the value that will appear in the contact's "Unsubscription Cause" field by choosing from the default values offered. These values can still be customized according to your needs.
Report of the processed file
Create a report for the processed file with the import activity. You can choose one of these record types:
- Text file (.csv)
- Excel file (.xlsx)
- Fixed-length file
If you do not want magnews to create a report for the processed file, select "None" as the report type.
Ending
In this section, choose if and where you want to save the activity report:
If you wish to save files in FTP of this account, you will need to specify the destination folder of the platform.
If you prefer to save the files on a File Server, you will need to select the server and destination folder.
Instead, select Do not send the report if you decide not to create a report for the processed file.
Task execution
Once all parameters are set, select the Save button at the top right of the page.
If you wish to execute immediately, click on Run now at the top right. You will be asked to confirm the immediate start of the execution.
At its conclusion, a detailed report will inform you of its outcome.