forked from nopSolutions/nopCommerce
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInstallRequiredData.cs
More file actions
3672 lines (3501 loc) · 186 KB
/
Copy pathInstallRequiredData.cs
File metadata and controls
3672 lines (3501 loc) · 186 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
using System.ComponentModel;
using System.Globalization;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
using Nop.Core;
using Nop.Core.Configuration;
using Nop.Core.Domain;
using Nop.Core.Domain.ArtificialIntelligence;
using Nop.Core.Domain.Blogs;
using Nop.Core.Domain.Catalog;
using Nop.Core.Domain.Common;
using Nop.Core.Domain.Configuration;
using Nop.Core.Domain.Customers;
using Nop.Core.Domain.Directory;
using Nop.Core.Domain.FilterLevels;
using Nop.Core.Domain.Gdpr;
using Nop.Core.Domain.Localization;
using Nop.Core.Domain.Logging;
using Nop.Core.Domain.Media;
using Nop.Core.Domain.Menus;
using Nop.Core.Domain.Messages;
using Nop.Core.Domain.Orders;
using Nop.Core.Domain.Payments;
using Nop.Core.Domain.ScheduleTasks;
using Nop.Core.Domain.Security;
using Nop.Core.Domain.Seo;
using Nop.Core.Domain.Shipping;
using Nop.Core.Domain.Stores;
using Nop.Core.Domain.Tax;
using Nop.Core.Domain.Topics;
using Nop.Core.Domain.Translation;
using Nop.Core.Domain.Vendors;
using Nop.Core.Http;
using Nop.Core.Security;
using Nop.Services.ArtificialIntelligence;
using Nop.Services.Catalog;
using Nop.Services.Common;
using Nop.Services.Customers;
using Nop.Services.Helpers;
using Nop.Services.Media;
using Nop.Services.Messages;
using Nop.Services.Seo;
namespace Nop.Services.Installation;
public partial class InstallationService
{
#region Utilities
/// <summary>
/// Installs a default stores
/// </summary>
/// <returns>
/// A task that represents the asynchronous operation
/// </returns>
protected virtual async Task InstallStoresAsync()
{
var storeUrl = _webHelper.GetStoreLocation();
var stores = new List<Store>
{
new() {
Name = "Your store name",
DefaultTitle = "Your store",
DefaultMetaKeywords = string.Empty,
DefaultMetaDescription = string.Empty,
HomepageTitle = "Home page title",
HomepageDescription = "Home page description",
Url = storeUrl,
SslEnabled = _webHelper.IsCurrentConnectionSecured(),
Hosts = "yourstore.com,www.yourstore.com",
DisplayOrder = 1,
//should we set some default company info?
CompanyName = "Your company name",
CompanyAddress = "your company country, state, zip, street, etc",
CompanyPhoneNumber = "(123) 456-78901",
CompanyVat = null
}
};
await _dataProvider.BulkInsertEntitiesAsync(stores);
}
/// <summary>
/// Installs a default measures
/// </summary>
/// <returns>
/// A task that represents the asynchronous operation
/// </returns>
protected virtual async Task InstallMeasuresAsync()
{
var isMetric = _installationSettings.RegionInfo?.IsMetric ?? false;
var measureDimensions = new List<MeasureDimension>
{
new() {
Name = "inch(es)",
SystemKeyword = "inches",
Ratio = isMetric ? 39.3701M : 1M,
DisplayOrder = isMetric ? 1 : 0
},
new() {
Name = "feet",
SystemKeyword = "feet",
Ratio = isMetric ? 3.28084M : 0.08333333M,
DisplayOrder = isMetric ? 1 : 0
},
new() {
Name = "meter(s)",
SystemKeyword = "meters",
Ratio = isMetric ? 1M : 0.0254M,
DisplayOrder = isMetric ? 0 : 1
},
new() {
Name = "millimetre(s)",
SystemKeyword = "millimetres",
Ratio = isMetric ? 1000M : 25.4M,
DisplayOrder = isMetric ? 0 : 1
}
};
await _dataProvider.BulkInsertEntitiesAsync(measureDimensions);
var measureWeights = new List<MeasureWeight>
{
new() {
Name = "ounce(s)",
SystemKeyword = "ounce",
Ratio = isMetric ? 35.274M : 16M,
DisplayOrder = isMetric ? 1 : 0
},
new() {
Name = "lb(s)",
SystemKeyword = "lb",
Ratio = isMetric ? 2.20462M : 1M,
DisplayOrder = isMetric ? 1 : 0
},
new() {
Name = "kg(s)",
SystemKeyword = "kg",
Ratio = isMetric ? 1M : 0.45359237M,
DisplayOrder = isMetric ? 0 : 1
},
new() {
Name = "gram(s)",
SystemKeyword = "grams",
Ratio = isMetric ? 1000M : 453.59237M,
DisplayOrder = isMetric ? 0 : 1
}
};
await _dataProvider.BulkInsertEntitiesAsync(measureWeights);
}
/// <summary>
/// Installs a default tax categories
/// </summary>
/// <returns>
/// A task that represents the asynchronous operation
/// </returns>
protected virtual async Task InstallTaxCategoriesAsync()
{
var taxCategories = new List<TaxCategory>
{
new() {Name = "Books", DisplayOrder = 1},
new() {Name = "Electronics & Software", DisplayOrder = 5},
new() {Name = "Downloadable Products", DisplayOrder = 10},
new() {Name = "Jewelry", DisplayOrder = 15},
new() {Name = "Apparel", DisplayOrder = 20}
};
await _dataProvider.BulkInsertEntitiesAsync(taxCategories);
}
/// <summary>
/// Import language resources from XML file
/// </summary>
/// <param name="language">Language</param>
/// <param name="xmlStreamReader">Stream reader of XML file</param>
/// <param name="updateExistingResources">A value indicating whether to update existing resources</param>
/// <returns>A task that represents the asynchronous operation</returns>
protected virtual async Task ImportResourcesFromXmlAsync(Language language, StreamReader xmlStreamReader, bool updateExistingResources = true)
{
var parsedResources = loadLocaleResourcesFromStream();
if (!parsedResources.Any())
return;
var lsNamesList = new Dictionary<string, LocaleStringResource>();
foreach (var localeStringResource in Table<LocaleStringResource>().Where(lsr => lsr.LanguageId == language.Id)
.OrderBy(lsr => lsr.Id))
{
lsNamesList[localeStringResource.ResourceName.ToLowerInvariant()] = localeStringResource;
}
var lrsToUpdateList = new List<LocaleStringResource>();
var lrsToInsertList = new Dictionary<string, LocaleStringResource>();
foreach (var (name, value) in parsedResources)
{
if (lsNamesList.TryGetValue(name, out var localString))
{
if (!updateExistingResources)
continue;
localString.ResourceValue = value;
lrsToUpdateList.Add(localString);
}
else
{
lrsToInsertList[name] = new LocaleStringResource
{
LanguageId = language.Id,
ResourceName = name,
ResourceValue = value
};
}
}
if (lrsToUpdateList.Any())
await _dataProvider.UpdateEntitiesAsync(lrsToUpdateList);
if (lrsToInsertList.Any())
await _dataProvider.BulkInsertEntitiesAsync(lrsToInsertList.Values);
return;
HashSet<(string name, string value)> loadLocaleResourcesFromStream()
{
var result = new HashSet<(string name, string value)>();
try
{
using var xmlReader = XmlReader.Create(xmlStreamReader);
while (xmlReader.ReadToFollowing("Language"))
{
if (xmlReader.NodeType != XmlNodeType.Element)
continue;
using var languageReader = xmlReader.ReadSubtree();
while (languageReader.ReadToFollowing("LocaleResource"))
{
if (xmlReader.NodeType != XmlNodeType.Element || xmlReader.GetAttribute("Name") is not { } name)
continue;
using var lrReader = languageReader.ReadSubtree();
if (lrReader.ReadToFollowing("Value") && lrReader.NodeType == XmlNodeType.Element)
result.Add((name.ToLowerInvariant(), lrReader.ReadString()));
}
break;
}
}
catch (XmlException)
{
//ignore
}
return result;
}
}
/// <summary>
/// Import states from TXT file
/// </summary>
/// <param name="stream">Stream</param>
/// <returns>
/// A task that represents the asynchronous operation
/// The task result contains the number of imported states
/// </returns>
protected virtual async Task<int> ImportStatesFromTxtAsync(Stream stream)
{
var count = 0;
using var reader = new StreamReader(stream);
string line;
while ((line = await reader.ReadLineAsync()) != null)
{
if (string.IsNullOrWhiteSpace(line))
continue;
var tmp = line.Split(',');
if (tmp.Length != 5)
throw new NopException("Wrong file format");
//parse
var countryTwoLetterIsoCode = tmp[0].Trim();
var name = tmp[1].Trim();
var abbreviation = tmp[2].Trim();
var published = bool.Parse(tmp[3].Trim());
var displayOrder = int.Parse(tmp[4].Trim());
var country = await Table<Country>().Where(c => c.TwoLetterIsoCode == countryTwoLetterIsoCode).FirstOrDefaultAsync();
//country cannot be loaded. skip
if (country == null)
continue;
//import
var states = await Table<StateProvince>()
.OrderBy(sp => sp.DisplayOrder)
.ThenBy(sp => sp.Name)
.Where(sp => sp.CountryId == country.Id)
.ToListAsync();
var state = states.FirstOrDefault(x => x.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase));
if (state != null)
{
state.Abbreviation = abbreviation;
state.Published = published;
state.DisplayOrder = displayOrder;
await _dataProvider.UpdateEntityAsync(state);
}
else
{
state = new StateProvince
{
CountryId = country.Id,
Name = name,
Abbreviation = abbreviation,
Published = published,
DisplayOrder = displayOrder
};
await _dataProvider.InsertEntityAsync(state);
}
count++;
}
return count;
}
/// <summary>
/// Installs a default languages
/// </summary>
/// <returns>A task that represents the asynchronous operation</returns>
protected virtual async Task InstallLanguagesAsync()
{
var defaultCulture = new CultureInfo(NopCommonDefaults.DefaultLanguageCulture);
var re = new Regex(" \\(.*\\)", RegexOptions.Compiled);
var languageName = re.Replace(defaultCulture.NativeName, string.Empty);
languageName = languageName[0].ToString().ToUpper() + languageName[1..];
var defaultLanguage = new Language
{
Name = languageName,
LanguageCulture = defaultCulture.Name,
UniqueSeoCode = defaultCulture.TwoLetterISOLanguageName,
FlagImageFileName = $"{defaultCulture.Name.ToLowerInvariant()[^2..]}.png",
Rtl = defaultCulture.TextInfo.IsRightToLeft,
Published = true,
DisplayOrder = 1
};
await _dataProvider.InsertEntityAsync(defaultLanguage);
//Install locale resources for default culture
var directoryPath = _fileProvider.MapPath(NopInstallationDefaults.LocalizationResourcesPath);
var pattern = $"*.{NopInstallationDefaults.LocalizationResourcesFileExtension}";
foreach (var filePath in _fileProvider.EnumerateFiles(directoryPath, pattern))
{
using var streamReader = new StreamReader(filePath);
await ImportResourcesFromXmlAsync(defaultLanguage, streamReader);
}
var cultureInfo = _installationSettings.CultureInfo;
var regionInfo = _installationSettings.RegionInfo;
if (cultureInfo == null || regionInfo == null || cultureInfo.Name == NopCommonDefaults.DefaultLanguageCulture)
return;
languageName = re.Replace(cultureInfo.NativeName, string.Empty);
languageName = languageName[0].ToString().ToUpper() + languageName[1..];
var language = new Language
{
Name = languageName,
LanguageCulture = cultureInfo.Name,
UniqueSeoCode = cultureInfo.TwoLetterISOLanguageName,
FlagImageFileName = $"{regionInfo.TwoLetterISORegionName.ToLowerInvariant()}.png",
Rtl = cultureInfo.TextInfo.IsRightToLeft,
Published = true,
DisplayOrder = 2
};
await _dataProvider.InsertEntityAsync(language);
if (string.IsNullOrEmpty(_installationSettings.LanguagePackDownloadLink))
return;
//download and import language pack
try
{
var httpClient = _httpClientFactory.CreateClient(NopHttpDefaults.DefaultHttpClient);
await using var stream = await httpClient.GetStreamAsync(_installationSettings.LanguagePackDownloadLink);
using var streamReader = new StreamReader(stream);
await ImportResourcesFromXmlAsync(language, streamReader);
//set this language as default
language.DisplayOrder = 0;
await _dataProvider.UpdateEntityAsync(language);
//save progress for showing in admin panel (only for first start)
await _dataProvider.InsertEntityAsync(new GenericAttribute
{
EntityId = language.Id,
Key = NopCommonDefaults.LanguagePackProgressAttribute,
KeyGroup = nameof(Language),
Value = _installationSettings.LanguagePackProgress.ToString(),
StoreId = 0,
CreatedOrUpdatedDateUTC = DateTime.UtcNow
});
}
catch
{
// ignored
}
}
/// <summary>
/// Installs a default currencies
/// </summary>
/// <returns>A task that represents the asynchronous operation</returns>
protected virtual async Task InstallCurrenciesAsync()
{
//set some currencies with a rate against the USD
var defaultCurrencies = new List<string> { "USD", "AUD", "GBP", "CAD", "CNY", "EUR", "HKD", "JPY", "RUB", "SEK", "INR" };
var currencies = new List<Currency>
{
new() {
Name = "US Dollar",
CurrencyCode = "USD",
Rate = 1,
DisplayLocale = "en-US",
CustomFormatting = string.Empty,
Published = true,
DisplayOrder = 1,
CreatedOnUtc = DateTime.UtcNow,
UpdatedOnUtc = DateTime.UtcNow,
RoundingType = RoundingType.Rounding001
},
new() {
Name = "Australian Dollar",
CurrencyCode = "AUD",
Rate = 1.34M,
DisplayLocale = "en-AU",
CustomFormatting = string.Empty,
Published = false,
DisplayOrder = 2,
CreatedOnUtc = DateTime.UtcNow,
UpdatedOnUtc = DateTime.UtcNow,
RoundingType = RoundingType.Rounding001
},
new() {
Name = "British Pound",
CurrencyCode = "GBP",
Rate = 0.75M,
DisplayLocale = "en-GB",
CustomFormatting = string.Empty,
Published = false,
DisplayOrder = 3,
CreatedOnUtc = DateTime.UtcNow,
UpdatedOnUtc = DateTime.UtcNow,
RoundingType = RoundingType.Rounding001
},
new() {
Name = "Canadian Dollar",
CurrencyCode = "CAD",
Rate = 1.32M,
DisplayLocale = "en-CA",
CustomFormatting = string.Empty,
Published = false,
DisplayOrder = 4,
CreatedOnUtc = DateTime.UtcNow,
UpdatedOnUtc = DateTime.UtcNow,
RoundingType = RoundingType.Rounding001
},
new() {
Name = "Chinese Yuan Renminbi",
CurrencyCode = "CNY",
Rate = 6.43M,
DisplayLocale = "zh-CN",
CustomFormatting = string.Empty,
Published = false,
DisplayOrder = 5,
CreatedOnUtc = DateTime.UtcNow,
UpdatedOnUtc = DateTime.UtcNow,
RoundingType = RoundingType.Rounding001
},
new() {
Name = "Euro",
CurrencyCode = "EUR",
Rate = 0.86M,
DisplayLocale = string.Empty,
CustomFormatting = $"{"\u20ac"}0.00", //euro symbol
Published = false,
DisplayOrder = 6,
CreatedOnUtc = DateTime.UtcNow,
UpdatedOnUtc = DateTime.UtcNow,
RoundingType = RoundingType.Rounding001
},
new() {
Name = "Hong Kong Dollar",
CurrencyCode = "HKD",
Rate = 7.84M,
DisplayLocale = "zh-HK",
CustomFormatting = string.Empty,
Published = false,
DisplayOrder = 7,
CreatedOnUtc = DateTime.UtcNow,
UpdatedOnUtc = DateTime.UtcNow,
RoundingType = RoundingType.Rounding001
},
new() {
Name = "Japanese Yen",
CurrencyCode = "JPY",
Rate = 110.45M,
DisplayLocale = "ja-JP",
CustomFormatting = string.Empty,
Published = false,
DisplayOrder = 8,
CreatedOnUtc = DateTime.UtcNow,
UpdatedOnUtc = DateTime.UtcNow,
RoundingType = RoundingType.Rounding001
},
new() {
Name = "Russian Rouble",
CurrencyCode = "RUB",
Rate = 63.25M,
DisplayLocale = "ru-RU",
CustomFormatting = string.Empty,
Published = false,
DisplayOrder = 9,
CreatedOnUtc = DateTime.UtcNow,
UpdatedOnUtc = DateTime.UtcNow,
RoundingType = RoundingType.Rounding001
},
new() {
Name = "Swedish Krona",
CurrencyCode = "SEK",
Rate = 8.80M,
DisplayLocale = "sv-SE",
CustomFormatting = string.Empty,
Published = false,
DisplayOrder = 10,
CreatedOnUtc = DateTime.UtcNow,
UpdatedOnUtc = DateTime.UtcNow,
RoundingType = RoundingType.Rounding1
},
new() {
Name = "Indian Rupee",
CurrencyCode = "INR",
Rate = 68.03M,
DisplayLocale = "en-IN",
CustomFormatting = string.Empty,
Published = false,
DisplayOrder = 12,
CreatedOnUtc = DateTime.UtcNow,
UpdatedOnUtc = DateTime.UtcNow,
RoundingType = RoundingType.Rounding001
}
};
//set additional currency
var cultureInfo = _installationSettings.CultureInfo;
var regionInfo = _installationSettings.RegionInfo;
if (cultureInfo != null && regionInfo != null)
{
if (!defaultCurrencies.Contains(regionInfo.ISOCurrencySymbol))
{
currencies.Add(new Currency
{
Name = regionInfo.CurrencyEnglishName,
CurrencyCode = regionInfo.ISOCurrencySymbol,
Rate = 1,
DisplayLocale = cultureInfo.Name,
CustomFormatting = string.Empty,
Published = true,
DisplayOrder = 0,
CreatedOnUtc = DateTime.UtcNow,
UpdatedOnUtc = DateTime.UtcNow,
RoundingType = RoundingType.Rounding001
});
}
foreach (var currency in currencies.Where(currency => currency.CurrencyCode == regionInfo.ISOCurrencySymbol))
{
currency.Published = true;
currency.DisplayOrder = 0;
}
}
await _dataProvider.BulkInsertEntitiesAsync(currencies);
}
/// <summary>
/// Installs a default countries and states
/// </summary>
/// <returns>
/// A task that represents the asynchronous operation
/// </returns>
protected virtual async Task InstallCountriesAndStatesAsync()
{
var countries = ISO3166.GetCollection().Select(country => new Country
{
Name = country.Name,
AllowsBilling = true,
AllowsShipping = true,
TwoLetterIsoCode = country.Alpha2,
ThreeLetterIsoCode = country.Alpha3,
NumericIsoCode = country.NumericCode,
SubjectToVat = country.SubjectToVat,
DisplayOrder = country.NumericCode == 840 ? 1 : 100,
Published = true
}).ToList();
await _dataProvider.BulkInsertEntitiesAsync(countries.ToArray());
//import states for all countries
var directoryPath = _fileProvider.MapPath(NopInstallationDefaults.LocalizationResourcesPath);
var pattern = "*.txt";
foreach (var filePath in _fileProvider.EnumerateFiles(directoryPath, pattern))
{
await using var stream = new FileStream(filePath, FileMode.Open);
await ImportStatesFromTxtAsync(stream);
}
}
/// <summary>
/// Installs a default shipping methods
/// </summary>
/// <returns>A task that represents the asynchronous operation</returns>
protected virtual async Task InstallShippingMethodsAsync()
{
var shippingMethods = new List<ShippingMethod>
{
new() {
Name = "Ground",
Description =
"Shipping by land transport",
DisplayOrder = 1
},
new() {
Name = "Next Day Air",
Description = "The one day air shipping",
DisplayOrder = 2
},
new() {
Name = "2nd Day Air",
Description = "The two day air shipping",
DisplayOrder = 3
}
};
await _dataProvider.BulkInsertEntitiesAsync(shippingMethods);
}
/// <summary>
/// Installs a default delivery dates
/// </summary>
/// <returns>A task that represents the asynchronous operation</returns>
protected virtual async Task InstallDeliveryDatesAsync()
{
var deliveryDates = new List<DeliveryDate>
{
new() {
Name = "1-2 days",
DisplayOrder = 1
},
new() {
Name = "3-5 days",
DisplayOrder = 5
},
new() {
Name = "1 week",
DisplayOrder = 10
}
};
await _dataProvider.BulkInsertEntitiesAsync(deliveryDates);
}
/// <summary>
/// Installs a default product availability ranges
/// </summary>
/// <returns>A task that represents the asynchronous operation</returns>
protected virtual async Task InstallProductAvailabilityRangesAsync()
{
var productAvailabilityRanges = new List<ProductAvailabilityRange>
{
new() {
Name = "2-4 days",
DisplayOrder = 1
},
new() {
Name = "7-10 days",
DisplayOrder = 2
},
new() {
Name = "2 weeks",
DisplayOrder = 3
}
};
await _dataProvider.BulkInsertEntitiesAsync(productAvailabilityRanges);
}
/// <summary>
/// Installs a default email accounts
/// </summary>
/// <returns>A task that represents the asynchronous operation</returns>
protected virtual async Task InstallEmailAccountsAsync()
{
var emailAccounts = new List<EmailAccount>
{
new() {
Email = "test@mail.com",
DisplayName = "Store name",
Host = "smtp.mail.com",
Port = 25,
Username = "123",
Password = "123",
EnableSsl = false
}
};
await _dataProvider.BulkInsertEntitiesAsync(emailAccounts);
}
/// <summary>
/// Installs a default message templates
/// </summary>
/// <returns>A task that represents the asynchronous operation</returns>
protected virtual async Task InstallMessageTemplatesAsync()
{
var eaGeneral = await Table<EmailAccount>().FirstOrDefaultAsync() ?? throw new Exception("Default email account cannot be loaded");
var messageTemplates = new List<MessageTemplate>
{
new() {
Name = MessageTemplateSystemNames.BLOG_COMMENT_STORE_OWNER_NOTIFICATION,
Subject = "%Store.Name%. New blog comment.",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}A new blog comment has been created for blog post \"%BlogComment.BlogPostTitle%\".{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.BACK_IN_STOCK_NOTIFICATION,
Subject = "%Store.Name%. Back in stock notification",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Hello %Customer.FullName%,{Environment.NewLine}<br />{Environment.NewLine}Product <a target=\"_blank\" href=\"%BackInStockSubscription.ProductUrl%\">%BackInStockSubscription.ProductName%</a> is in stock.{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.CUSTOMER_EMAIL_VALIDATION_MESSAGE,
Subject = "%Store.Name%. Email validation",
Body = $"<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}To activate your account <a href=\"%Customer.AccountActivationURL%\">click here</a>.{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%Store.Name%{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.CUSTOMER_EMAIL_REVALIDATION_MESSAGE,
Subject = "%Store.Name%. Email validation",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Hello %Customer.FullName%!{Environment.NewLine}<br />{Environment.NewLine}To validate your new email address <a href=\"%Customer.EmailRevalidationURL%\">click here</a>.{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%Store.Name%{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.PRIVATE_MESSAGE_NOTIFICATION,
Subject = "%Store.Name%. You have received a new private message",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}You have received a new private message.{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.CUSTOMER_PASSWORD_RECOVERY_MESSAGE,
Subject = "%Store.Name%. Password recovery",
Body = $"<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}To change your password <a href=\"%Customer.PasswordRecoveryURL%\">click here</a>.{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%Store.Name%{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.CUSTOMER_WELCOME_MESSAGE,
Subject = "Welcome to %Store.Name%",
Body = $"We welcome you to <a href=\"%Store.URL%\"> %Store.Name%</a>.{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}You can now take part in the various services we have to offer you. Some of these services include:{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Permanent Cart - Any products added to your online cart remain there until you remove them, or check them out.{Environment.NewLine}<br />{Environment.NewLine}Address Book - We can now deliver your products to another address other than yours! This is perfect to send birthday gifts direct to the birthday-person themselves.{Environment.NewLine}<br />{Environment.NewLine}Order History - View your history of purchases that you have made with us.{Environment.NewLine}<br />{Environment.NewLine}Products Reviews - Share your opinions on products with our other customers.{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}For help with any of our online services, please email the store-owner: <a href=\"mailto:%Store.Email%\">%Store.Email%</a>.{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Note: This email address was provided on our registration page. If you own the email and did not register on our site, please send an email to <a href=\"mailto:%Store.Email%\">%Store.Email%</a>.{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.GIFT_CARD_NOTIFICATION,
Subject = "%GiftCard.SenderName% has sent you a gift card for %Store.Name%",
Body = $"<p>{Environment.NewLine}You have received a gift card for %Store.Name%{Environment.NewLine}</p>{Environment.NewLine}<p>{Environment.NewLine}Dear %GiftCard.RecipientName%,{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%GiftCard.SenderName% (%GiftCard.SenderEmail%) has sent you a %GiftCard.Amount% gift card for <a href=\"%Store.URL%\"> %Store.Name%</a>{Environment.NewLine}</p>{Environment.NewLine}<p>{Environment.NewLine}Your gift card code is %GiftCard.CouponCode%{Environment.NewLine}</p>{Environment.NewLine}<p>{Environment.NewLine}%GiftCard.Message%{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.CUSTOMER_REGISTERED_STORE_OWNER_NOTIFICATION,
Subject = "%Store.Name%. New customer registration",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}A new customer registered with your store. Below are the customer's details:{Environment.NewLine}<br />{Environment.NewLine}Full name: %Customer.FullName%{Environment.NewLine}<br />{Environment.NewLine}Email: %Customer.Email%{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.NEW_RETURN_REQUEST_STORE_OWNER_NOTIFICATION,
Subject = "%Store.Name%. New return request.",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%Customer.FullName% has just submitted a new return request. Details are below:{Environment.NewLine}<br />{Environment.NewLine}Request ID: %ReturnRequest.CustomNumber%{Environment.NewLine}<br />{Environment.NewLine}Product: %ReturnRequest.Product.Quantity% x Product: %ReturnRequest.Product.Name%{Environment.NewLine}<br />{Environment.NewLine}Reason for return: %ReturnRequest.Reason%{Environment.NewLine}<br />{Environment.NewLine}Requested action: %ReturnRequest.RequestedAction%{Environment.NewLine}<br />{Environment.NewLine}Customer comments:{Environment.NewLine}<br />{Environment.NewLine}%ReturnRequest.CustomerComment%{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new()
{
Name = MessageTemplateSystemNames.DELETE_CUSTOMER_REQUEST_STORE_OWNER_NOTIFICATION,
Subject = "%Store.Name%. New request to delete customer (GDPR)",
Body = $"%Customer.Email% has requested account deletion. You can consider this in the admin area.",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.NEW_RETURN_REQUEST_CUSTOMER_NOTIFICATION,
Subject = "%Store.Name%. New return request.",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Hello %Customer.FullName%!{Environment.NewLine}<br />{Environment.NewLine}You have just submitted a new return request. Details are below:{Environment.NewLine}<br />{Environment.NewLine}Request ID: %ReturnRequest.CustomNumber%{Environment.NewLine}<br />{Environment.NewLine}Product: %ReturnRequest.Product.Quantity% x Product: %ReturnRequest.Product.Name%{Environment.NewLine}<br />{Environment.NewLine}Reason for return: %ReturnRequest.Reason%{Environment.NewLine}<br />{Environment.NewLine}Requested action: %ReturnRequest.RequestedAction%{Environment.NewLine}<br />{Environment.NewLine}Customer comments:{Environment.NewLine}<br />{Environment.NewLine}%ReturnRequest.CustomerComment%{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.NEWSLETTER_SUBSCRIPTION_ACTIVATION_MESSAGE,
Subject = "%Store.Name%. Subscription activation message.",
Body = $"<p>{Environment.NewLine}<a href=\"%NewsLetterSubscription.ActivationUrl%\">Click here to confirm your subscription to our list.</a>{Environment.NewLine}</p>{Environment.NewLine}<p>{Environment.NewLine}If you received this email by mistake, simply delete it.{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.NEWSLETTER_SUBSCRIPTION_DEACTIVATION_MESSAGE,
Subject = "%Store.Name%. Subscription deactivation message.",
Body = $"<p>{Environment.NewLine}<a href=\"%NewsLetterSubscription.DeactivationUrl%\">Click here to unsubscribe from our newsletter.</a>{Environment.NewLine}</p>{Environment.NewLine}<p>{Environment.NewLine}If you received this email by mistake, simply delete it.{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.NEW_VAT_SUBMITTED_STORE_OWNER_NOTIFICATION,
Subject = "%Store.Name%. New VAT number is submitted.",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%Customer.FullName% (%Customer.Email%) has just submitted a new VAT number. Details are below:{Environment.NewLine}<br />{Environment.NewLine}VAT number: %Customer.VatNumber%{Environment.NewLine}<br />{Environment.NewLine}VAT number status: %Customer.VatNumberStatus%{Environment.NewLine}<br />{Environment.NewLine}Received name: %VatValidationResult.Name%{Environment.NewLine}<br />{Environment.NewLine}Received address: %VatValidationResult.Address%{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.ORDER_CANCELLED_CUSTOMER_NOTIFICATION,
Subject = "%Store.Name%. Your order cancelled",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Hello %Order.CustomerFullName%,{Environment.NewLine}<br />{Environment.NewLine}Your order has been cancelled. Below is the summary of the order.{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Order Number: %Order.OrderNumber%{Environment.NewLine}<br />{Environment.NewLine}Order Details: <a target=\"_blank\" href=\"%Order.OrderURLForCustomer%\">%Order.OrderURLForCustomer%</a>{Environment.NewLine}<br />{Environment.NewLine}Date Ordered: %Order.CreatedOn%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Billing Address{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingFirstName% %Order.BillingLastName%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingAddress1%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingAddress2%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingCity% %Order.BillingZipPostalCode%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingStateProvince% %Order.BillingCountry%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%if (%Order.Shippable%) Shipping Address{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingFirstName% %Order.ShippingLastName%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingAddress1%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingAddress2%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingCity% %Order.ShippingZipPostalCode%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingStateProvince% %Order.ShippingCountry%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Shipping Method: %Order.ShippingMethod%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine} endif% %Order.Product(s)%{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.ORDER_CANCELLED_STORE_OWNER_NOTIFICATION,
Subject = "%Store.Name%. Order #%Order.OrderNumber% cancelled",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Order #%Order.OrderNumber% has been cancelled by customer.{Environment.NewLine}<br />{Environment.NewLine}Customer: %Order.CustomerFullName%,{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Order Number: %Order.OrderNumber%{Environment.NewLine}<br />{Environment.NewLine}Date Ordered: %Order.CreatedOn%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%Order.Product(s)%{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.ORDER_CANCELLED_VENDOR_NOTIFICATION,
Subject = "%Store.Name%. Order #%Order.OrderNumber% cancelled",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Order #%Order.OrderNumber% has been cancelled.{Environment.NewLine}<br />{Environment.NewLine}Customer: %Order.CustomerFullName%,{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Order Number: %Order.OrderNumber%{Environment.NewLine}<br />{Environment.NewLine}Date Ordered: %Order.CreatedOn%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%Order.Product(s)%{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.ORDER_PROCESSING_CUSTOMER_NOTIFICATION,
Subject = "%Store.Name%. Your order is processing",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Hello %Order.CustomerFullName%,{Environment.NewLine}<br />{Environment.NewLine}Your order is processing. Below is the summary of the order.{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Order Number: %Order.OrderNumber%{Environment.NewLine}<br />{Environment.NewLine}Order Details: <a target=\"_blank\" href=\"%Order.OrderURLForCustomer%\">%Order.OrderURLForCustomer%</a>{Environment.NewLine}<br />{Environment.NewLine}Date Ordered: %Order.CreatedOn%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Billing Address{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingFirstName% %Order.BillingLastName%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingAddress1%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingAddress2%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingCity% %Order.BillingZipPostalCode%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingStateProvince% %Order.BillingCountry%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%if (%Order.Shippable%) Shipping Address{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingFirstName% %Order.ShippingLastName%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingAddress1%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingAddress2%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingCity% %Order.ShippingZipPostalCode%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingStateProvince% %Order.ShippingCountry%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Shipping Method: %Order.ShippingMethod%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine} endif% %Order.Product(s)%{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = false,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.ORDER_COMPLETED_CUSTOMER_NOTIFICATION,
Subject = "%Store.Name%. Your order completed",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Hello %Order.CustomerFullName%,{Environment.NewLine}<br />{Environment.NewLine}Your order has been completed. Below is the summary of the order.{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Order Number: %Order.OrderNumber%{Environment.NewLine}<br />{Environment.NewLine}Order Details: <a target=\"_blank\" href=\"%Order.OrderURLForCustomer%\">%Order.OrderURLForCustomer%</a>{Environment.NewLine}<br />{Environment.NewLine}Date Ordered: %Order.CreatedOn%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Billing Address{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingFirstName% %Order.BillingLastName%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingAddress1%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingAddress2%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingCity% %Order.BillingZipPostalCode%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingStateProvince% %Order.BillingCountry%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%if (%Order.Shippable%) Shipping Address{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingFirstName% %Order.ShippingLastName%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingAddress1%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingAddress2%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingCity% %Order.ShippingZipPostalCode%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingStateProvince% %Order.ShippingCountry%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Shipping Method: %Order.ShippingMethod%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine} endif% %Order.Product(s)%{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.ORDER_COMPLETED_STORE_OWNER_NOTIFICATION,
Subject = "%Store.Name%. Order #%Order.OrderNumber% completed",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%Order.CustomerFullName% has just completed an order. Below is the summary of the order.{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Order Number: %Order.OrderNumber%{Environment.NewLine}<br />{Environment.NewLine}Date Ordered: %Order.CreatedOn%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Billing Address{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingFirstName% %Order.BillingLastName%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingAddress1%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingAddress2%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingCity% %Order.BillingZipPostalCode%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingStateProvince% %Order.BillingCountry%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%if (%Order.Shippable%) Shipping Address{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingFirstName% %Order.ShippingLastName%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingAddress1%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingAddress2%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingCity% %Order.ShippingZipPostalCode%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingStateProvince% %Order.ShippingCountry%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Shipping Method: %Order.ShippingMethod%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine} endif% %Order.Product(s)%{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = false, //this template is disabled by default
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.SHIPMENT_DELIVERED_CUSTOMER_NOTIFICATION,
Subject = "Your order from %Store.Name% has been %if (!%Order.IsCompletelyDelivered%) partially endif%delivered.",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\"> %Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Hello %Order.CustomerFullName%,{Environment.NewLine}<br />{Environment.NewLine}Good news! Your order has been %if (!%Order.IsCompletelyDelivered%) partially endif%delivered.{Environment.NewLine}<br />{Environment.NewLine}Order Number: %Order.OrderNumber%{Environment.NewLine}<br />{Environment.NewLine}Order Details: <a href=\"%Order.OrderURLForCustomer%\" target=\"_blank\">%Order.OrderURLForCustomer%</a>{Environment.NewLine}<br />{Environment.NewLine}Date Ordered: %Order.CreatedOn%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Billing Address{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingFirstName% %Order.BillingLastName%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingAddress1%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingAddress2%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingCity% %Order.BillingZipPostalCode%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingStateProvince% %Order.BillingCountry%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%if (%Order.Shippable%) Shipping Address{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingFirstName% %Order.ShippingLastName%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingAddress1%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingAddress2%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingAddress2%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingCity% %Order.ShippingZipPostalCode%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingStateProvince% %Order.ShippingCountry%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Shipping Method: %Order.ShippingMethod%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine} endif% Delivered Products:{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%Shipment.Product(s)%{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.ORDER_PLACED_CUSTOMER_NOTIFICATION,
Subject = "Order receipt from %Store.Name%.",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Hello %Order.CustomerFullName%,{Environment.NewLine}<br />{Environment.NewLine}Thanks for buying from <a href=\"%Store.URL%\">%Store.Name%</a>. Below is the summary of the order.{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Order Number: %Order.OrderNumber%{Environment.NewLine}<br />{Environment.NewLine}Order Details: <a target=\"_blank\" href=\"%Order.OrderURLForCustomer%\">%Order.OrderURLForCustomer%</a>{Environment.NewLine}<br />{Environment.NewLine}Date Ordered: %Order.CreatedOn%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Billing Address{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingFirstName% %Order.BillingLastName%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingAddress1%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingAddress2%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingCity% %Order.BillingZipPostalCode%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingStateProvince% %Order.BillingCountry%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%if (%Order.Shippable%) Shipping Address{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingFirstName% %Order.ShippingLastName%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingAddress1%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingAddress2%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingCity% %Order.ShippingZipPostalCode%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingStateProvince% %Order.ShippingCountry%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Shipping Method: %Order.ShippingMethod%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine} endif% %Order.Product(s)%{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.ORDER_PLACED_STORE_OWNER_NOTIFICATION,
Subject = "%Store.Name%. Purchase Receipt for Order #%Order.OrderNumber%",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%Order.CustomerFullName% (%Order.CustomerEmail%) has just placed an order from your store. Below is the summary of the order.{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Order Number: %Order.OrderNumber%{Environment.NewLine}<br />{Environment.NewLine}Date Ordered: %Order.CreatedOn%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Billing Address{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingFirstName% %Order.BillingLastName%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingAddress1%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingAddress2%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingCity% %Order.BillingZipPostalCode%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingStateProvince% %Order.BillingCountry%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%if (%Order.Shippable%) Shipping Address{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingFirstName% %Order.ShippingLastName%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingAddress1%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingAddress2%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingCity% %Order.ShippingZipPostalCode%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingStateProvince% %Order.ShippingCountry%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Shipping Method: %Order.ShippingMethod%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine} endif% %Order.Product(s)%{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.SHIPMENT_SENT_CUSTOMER_NOTIFICATION,
Subject = "Your order from %Store.Name% has been %if (!%Order.IsCompletelyShipped%) partially endif%shipped.",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\"> %Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Hello %Order.CustomerFullName%!,{Environment.NewLine}<br />{Environment.NewLine}Good news! Your order has been %if (!%Order.IsCompletelyShipped%) partially endif%shipped.{Environment.NewLine}<br />{Environment.NewLine}Order Number: %Order.OrderNumber%{Environment.NewLine}<br />{Environment.NewLine}Order Details: <a href=\"%Order.OrderURLForCustomer%\" target=\"_blank\">%Order.OrderURLForCustomer%</a>{Environment.NewLine}<br />{Environment.NewLine}Date Ordered: %Order.CreatedOn%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Billing Address{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingFirstName% %Order.BillingLastName%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingAddress1%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingAddress2%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingCity% %Order.BillingZipPostalCode%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingStateProvince% %Order.BillingCountry%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%if (%Order.Shippable%) Shipping Address{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingFirstName% %Order.ShippingLastName%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingAddress1%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingAddress2%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingCity% %Order.ShippingZipPostalCode%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingStateProvince% %Order.ShippingCountry%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Shipping Method: %Order.ShippingMethod%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine} endif% Shipped Products:{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%Shipment.Product(s)%{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.SHIPMENT_READY_FOR_PICKUP_CUSTOMER_NOTIFICATION,
Subject = "Your order from %Store.Name% has been %if (!%Order.IsCompletelyReadyForPickup%) partially endif%ready for pickup.",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\"> %Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Hello %Order.CustomerFullName%!,{Environment.NewLine}<br />{Environment.NewLine}Good news! Your order has been %if (!%Order.IsCompletelyReadyForPickup%) partially endif%ready for pickup.{Environment.NewLine}<br />{Environment.NewLine}Order Number: %Order.OrderNumber%{Environment.NewLine}<br />{Environment.NewLine}Order Details: <a href=\"%Order.OrderURLForCustomer%\" target=\"_blank\">%Order.OrderURLForCustomer%</a>{Environment.NewLine}<br />{Environment.NewLine}Date Ordered: %Order.CreatedOn%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Billing Address{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingFirstName% %Order.BillingLastName%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingAddress1%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingAddress2%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingCity% %Order.BillingZipPostalCode%{Environment.NewLine}<br />{Environment.NewLine}%Order.BillingStateProvince% %Order.BillingCountry%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%if (%Order.Shippable%) Shipping Address{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingFirstName% %Order.ShippingLastName%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingAddress1%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingAddress2%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingCity% %Order.ShippingZipPostalCode%{Environment.NewLine}<br />{Environment.NewLine}%Order.ShippingStateProvince% %Order.ShippingCountry%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Shipping Method: %Order.ShippingMethod%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine} endif% Products ready for pickup:{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%Shipment.Product(s)%{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.PRODUCT_REVIEW_STORE_OWNER_NOTIFICATION,
Subject = "%Store.Name%. New product review.",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}A new product review has been written for product \"%ProductReview.ProductName%\".{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.PRODUCT_REVIEW_REPLY_CUSTOMER_NOTIFICATION,
Subject = "%Store.Name%. Product review reply.",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Hello %Customer.FullName%,{Environment.NewLine}<br />{Environment.NewLine}You received a reply from the store administration to your review for product \"%ProductReview.ProductName%\".{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = false,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.QUANTITY_BELOW_STORE_OWNER_NOTIFICATION,
Subject = "%Store.Name%. Quantity below notification. %Product.Name%",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%Product.Name% (ID: %Product.ID%) low quantity.{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Quantity: %Product.StockQuantity%{Environment.NewLine}<br />{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.QUANTITY_BELOW_ATTRIBUTE_COMBINATION_STORE_OWNER_NOTIFICATION,
Subject = "%Store.Name%. Quantity below notification. %Product.Name%",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%Product.Name% (ID: %Product.ID%) low quantity.{Environment.NewLine}<br />{Environment.NewLine}%AttributeCombination.Formatted%{Environment.NewLine}<br />{Environment.NewLine}Quantity: %AttributeCombination.StockQuantity%{Environment.NewLine}<br />{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.QUANTITY_BELOW_VENDOR_NOTIFICATION,
Subject = "%Store.Name%. Quantity below notification. %Product.Name%",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%Product.Name% (ID: %Product.ID%) low quantity.{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Quantity: %Product.StockQuantity%{Environment.NewLine}<br />{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.QUANTITY_BELOW_ATTRIBUTE_COMBINATION_VENDOR_NOTIFICATION,
Subject = "%Store.Name%. Quantity below notification. %Product.Name%",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%Product.Name% (ID: %Product.ID%) low quantity.{Environment.NewLine}<br />{Environment.NewLine}%AttributeCombination.Formatted%{Environment.NewLine}<br />{Environment.NewLine}Quantity: %AttributeCombination.StockQuantity%{Environment.NewLine}<br />{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.RETURN_REQUEST_STATUS_CHANGED_CUSTOMER_NOTIFICATION,
Subject = "%Store.Name%. Return request status was changed.",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Hello %Customer.FullName%,{Environment.NewLine}<br />{Environment.NewLine}Your return request #%ReturnRequest.CustomNumber% status has been changed.{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.EMAIL_A_FRIEND_MESSAGE,
Subject = "%Store.Name%. Referred Item",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\"> %Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%EmailAFriend.Email% was shopping on %Store.Name% and wanted to share the following item with you.{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<b><a target=\"_blank\" href=\"%Product.ProductURLForCustomer%\">%Product.Name%</a></b>{Environment.NewLine}<br />{Environment.NewLine}%Product.ShortDescription%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}For more info click <a target=\"_blank\" href=\"%Product.ProductURLForCustomer%\">here</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%EmailAFriend.PersonalMessage%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%Store.Name%{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.WISHLIST_TO_FRIEND_MESSAGE,
Subject = "%Store.Name%. Wishlist",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\"> %Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%Wishlist.Email% was shopping on %Store.Name% and wanted to share a wishlist with you.{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}For more info click <a target=\"_blank\" href=\"%Wishlist.URLForCustomer%\">here</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%Wishlist.PersonalMessage%{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%Store.Name%{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.NEW_ORDER_NOTE_ADDED_CUSTOMER_NOTIFICATION,
Subject = "%Store.Name%. New order note has been added",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}Hello %Customer.FullName%,{Environment.NewLine}<br />{Environment.NewLine}New order note has been added to your account:{Environment.NewLine}<br />{Environment.NewLine}\"%Order.NewNoteText%\".{Environment.NewLine}<br />{Environment.NewLine}<a target=\"_blank\" href=\"%Order.OrderURLForCustomer%\">%Order.OrderURLForCustomer%</a>{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id
},
new() {
Name = MessageTemplateSystemNames.RECURRING_PAYMENT_CANCELLED_STORE_OWNER_NOTIFICATION,
Subject = "%Store.Name%. Recurring payment cancelled",
Body = $"<p>{Environment.NewLine}<a href=\"%Store.URL%\">%Store.Name%</a>{Environment.NewLine}<br />{Environment.NewLine}<br />{Environment.NewLine}%if (%RecurringPayment.CancelAfterFailedPayment%) The last payment for the recurring payment ID=%RecurringPayment.ID% failed, so it was cancelled. endif% %if (!%RecurringPayment.CancelAfterFailedPayment%) %Customer.FullName% (%Customer.Email%) has just cancelled a recurring payment ID=%RecurringPayment.ID%. endif%{Environment.NewLine}</p>{Environment.NewLine}",
IsActive = true,
EmailAccountId = eaGeneral.Id