Skip to content

Commit 0ce8fca

Browse files
Merge pull request #20 from Kentico/maint/code-cleanup
Code cleanup
2 parents 1bce423 + 97c1e0a commit 0ce8fca

24 files changed

+564
-422
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Copyright>Copyright © $(Company) $([System.DateTime]::Now.Year)</Copyright>
77
<Trademark>$(Company)™</Trademark>
88
<VersionPrefix>1.0.0</VersionPrefix>
9-
<VersionSuffix>prerelease-2</VersionSuffix>
9+
<VersionSuffix>prerelease-3</VersionSuffix>
1010
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1111

1212
<PackageProjectUrl>https://github.com/Kentico/xperience-by-kentico-contacts-importer</PackageProjectUrl>

README.md

Lines changed: 21 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,50 @@
11
# Xperience by Kentico Contacts Importer
22

33
[![Kentico Labs](https://img.shields.io/badge/Kentico_Labs-grey?labelColor=orange&logo=data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ic3ZnLWljb24iIHN0eWxlPSJ3aWR0aDogMWVtOyBoZWlnaHQ6IDFlbTt2ZXJ0aWNhbC1hbGlnbjogbWlkZGxlO2ZpbGw6IGN1cnJlbnRDb2xvcjtvdmVyZmxvdzogaGlkZGVuOyIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik05NTYuMjg4IDgwNC40OEw2NDAgMjc3LjQ0VjY0aDMyYzE3LjYgMCAzMi0xNC40IDMyLTMycy0xNC40LTMyLTMyLTMyaC0zMjBjLTE3LjYgMC0zMiAxNC40LTMyIDMyczE0LjQgMzIgMzIgMzJIMzg0djIxMy40NEw2Ny43MTIgODA0LjQ4Qy00LjczNiA5MjUuMTg0IDUxLjIgMTAyNCAxOTIgMTAyNGg2NDBjMTQwLjggMCAxOTYuNzM2LTk4Ljc1MiAxMjQuMjg4LTIxOS41MnpNMjQxLjAyNCA2NDBMNDQ4IDI5NS4wNFY2NGgxMjh2MjMxLjA0TDc4Mi45NzYgNjQwSDI0MS4wMjR6IiAgLz48L3N2Zz4=)](https://github.com/Kentico/.github/blob/main/SUPPORT.md#labs-limited-support)
4-
5-
[![CI: Build and Test](https://github.com/Kentico/xperience-by-kentico-contacts-importer/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/Kentico/xperience-by-kentico-contacts-importer/actions/workflows/ci.yml)
6-
4+
[![CI: Build and Test](https://github.com/Kentico/xperience-by-kentico-contacts-importer/actions/workflows/ci.yml/badge.svg)](https://github.com/Kentico/xperience-by-kentico-contacts-importer/actions/workflows/ci.yml)
75
[![NuGet Package](https://img.shields.io/nuget/v/Kentico.Xperience.Contacts.Importer.svg)](https://www.nuget.org/packages/Kentico.Xperience.Contacts.Importer)
86

9-
## About The Project
7+
## Description
108

11-
Enables bulk importing of Contacts into an Xperience by Kentico solution using a `.csv` file.
9+
Enables bulk import and deletion of contacts in an Xperience by Kentico solution using a `.csv` file. Imported contacts can be automatically assigned to a contact group during the import process.
1210

13-
![View of the Import Upload dashboard](https://github.com/user-attachments/assets/ae48f836-db00-4bae-8b43-e39482d73a3a)
11+
## Requirements
1412

15-
## Getting Started
13+
### Library Version Matrix
1614

17-
### Prerequisites
15+
| Xperience Version | Library Version |
16+
| ----------------- | --------------- |
17+
| >= 30.5.1 | 1.0.0-prerelease-2 |
1818

19-
- Xperience by Kentico >= 30.5.1
19+
### Dependencies
2020

21-
- <https://docs.kentico.com/documentation/changelog#hotfix-may-22-2025>
21+
- [ASP.NET Core 8.0](https://dotnet.microsoft.com/en-us/download)
22+
- [Xperience by Kentico](https://docs.kentico.com)
2223

23-
### Installation
24+
## Package Installation
2425

2526
Add the package to your application using the .NET CLI
2627

2728
```powershell
28-
dotnet add package Kentico.Xperience.Contacts.Importer
29+
dotnet add package --prerelease Kentico.Xperience.Contacts.Importer
2930
```
3031

31-
### Add to your application dependencies
32+
## Quick Start
3233

33-
```csharp
34-
builder.Services.AddKentico();
35-
// ... other registrations
36-
services.AddContactsImport();
37-
```
38-
39-
### Add to your middleware pipeline
34+
Add `AddContactsImport()` and `UseContactsImport()` to your application startup code:
4035

4136
```csharp
37+
builder.Services.AddContactsImport();
38+
// ... other service registrations
39+
4240
app.InitKentico();
43-
// ... other registrations
41+
// ... other middleware
4442
app.UseContactsImport();
4543
```
4644

47-
## Usage
48-
49-
1. open contact importer application <br>
50-
![ContactImporterApplication](./images/ContactImporterApplication.png)
51-
1. select file
52-
1. select mode
53-
1. Delete - this mode will delete contact by ContactGUID (CSV shall contain column with ContactGUID header)
54-
1. Insert (skip existing) - this mode will import contacts (CSV shall contain column with ContactGUID)
55-
1. "Assign to contact group" - all contact (existing included) will be assigned to specified group
56-
1. Delimiter - delimiter used for CSV (common are `;`, `,`, `\\t`, ..)
57-
1. "Batch size" - size of batch used for database operation, for instances with limited resources this value should not exeed 5000, lower than 100 is not reccomended.
58-
1. Click "Send file" button
59-
60-
> Depends on resources available to application, but degraded application performance is expected during import.
61-
62-
Notes:
63-
64-
- do not close window with progress, file is uploaded from that window.
65-
- do not manipulate file during import, close all applications write access to file (or lock)
66-
67-
### Supported CSV columns
68-
69-
| Column | .NET Type | Required |
70-
| ----------------- | --------- | -------- |
71-
| ContactGUID | Guid | yes |
72-
| ContactCreated | DateTime | yes |
73-
| ContactFirstName | string | no |
74-
| ContactLastName | string | no |
75-
| ContactEmail | string | no |
76-
| ContactAddress1 | string | no |
77-
| ContactMiddleName | string | no |
78-
79-
In the CSV file, define the first row as a header containing the names of the individual columns.
80-
Header validation is performed during the file upload. See example file [Contact Sample](https://github.com/Kentico/xperience-by-kentico-contacts-importer/blob/main/data/contact_sample.csv).
45+
## Full Instructions
8146

82-
> [!IMPORTANT]
83-
> For correct functionality, please make sure to add a newline at the end of the CSV file.
47+
View the [Usage Guide](./docs/Usage-Guide.md) for more detailed instructions.
8448

8549
## Contributing
8650

docs/Usage-Guide.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Usage Guide
2+
3+
## Screenshot
4+
5+
![Import page](../images/screenshot.png)
6+
7+
## Importing and deleting contacts
8+
9+
1. Open **Digital marketing > Contact importer** application
10+
11+
![App tile](../images/app-tile.png)
12+
13+
1. Upload your CSV file. See [Supported CSV columns](#supported-csv-columns) for help with formatting the data
14+
1. In the **Import mode** field, choose the import mode:
15+
- Insert: Imports new contacts while skipping existing contacts with matching ContactGUIDs from the CSV file
16+
- Delete: Deletes existing contacts using the ContactGUIDs from the CSV file
17+
1. If you would like to assign newly-imported contacts _and_ existing contacts to a contact group, select the group from the **Assign to contact group** dropdown. You may leave this option empty if you don't wish to assign the contacts to a group
18+
1. The **Delimiter** field can generally be skipped as the default character `,` is most common. Change this value if your CSV file uses a different character- common examples are `;` or `\\t`
19+
1. Customize the **Batch size** as needed. For instances with limited resources this value should not exeed 5000. A batch size lower than 100 is not recommended
20+
1. Click **Run import** to begin the process. Degraded application performance is expected during import
21+
22+
> [!CAUTION]
23+
> During the import process, do not:
24+
>
25+
> - Close the window
26+
> - Shut down the application
27+
> - Modify the CSV file
28+
29+
## Supported CSV columns
30+
31+
| Column | .NET Type | Required |
32+
| ----------------- | --------- | -------- |
33+
| ContactGUID | Guid | yes |
34+
| ContactCreated | DateTime | yes |
35+
| ContactFirstName | string | no |
36+
| ContactLastName | string | no |
37+
| ContactEmail | string | no |
38+
| ContactAddress1 | string | no |
39+
| ContactMiddleName | string | no |
40+
41+
The first row of the CSV file should contain the header names of the individual columns.
42+
Header validation is performed during the file upload. See the [sample file](https://github.com/Kentico/xperience-by-kentico-contacts-importer/blob/main/data/contact_sample.csv) for an example.
43+
44+
> [!IMPORTANT]
45+
> For correct functionality, please make sure to add a newline at the end of the CSV file.
-28.4 KB
Binary file not shown.

images/app-tile.png

25.8 KB
Loading

images/screenshot-upload.jpg

-100 KB
Binary file not shown.

images/screenshot.png

110 KB
Loading
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
// Exposes components from the module. All added components need to be exported.
2-
export * from './import/ImportLayoutTemplate';
1+
export * from './templates/ImportLayoutTemplate';
Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,41 @@
11
{
22
"integrations": {
3-
"contactsimporter": {
4-
"content": {
5-
"headlines": {
6-
"main": "Upload/Delete Contacts"
7-
}
8-
}
3+
"contactsimporter": {
4+
"messages": {
5+
"noFile": "No file was selected.",
6+
"errorUploading": "An error occurred while uploading the file.",
7+
"headersValidated": "CSV headers validated. Starting import.",
8+
"uploadComplete": "File upload complete.",
9+
"importComplete": "Import complete.",
10+
"sendingFile": "Sending file of length",
11+
"errorReading": "An error occurred while reading the file.",
12+
"unexpectedFile": "Unexpected file read result type.",
13+
"serverError": "Unexpected server error.",
14+
"readComplete": "Completed reading file.",
15+
"uploadPaused": "Pausing upload while contacts are imported."
16+
},
17+
"content": {
18+
"headlines": {
19+
"main": "Import contacts"
20+
},
21+
"labels": {
22+
"importMode": "Import mode",
23+
"insert": "Insert",
24+
"delete": "Delete",
25+
"contactGroup": "Assign to contact group",
26+
"uploadFileLine1": "Drag & drop CSV",
27+
"uploadFileLine2": "or",
28+
"uploadButton": "Browse",
29+
"delimiter": "Delimiter",
30+
"batchSize": "Batch size",
31+
"run": "Run import"
32+
},
33+
"explanations": {
34+
"contactGroup": "Assigns all contacts in CSV file to the selected group. Leave empty to skip assignment.",
35+
"delimiter": "The delimiter for CSV row data items.",
36+
"batchSize": "The number of records that will be uploaded and processed at a time."
37+
}
938
}
39+
}
1040
}
1141
}

0 commit comments

Comments
 (0)