@aglyn/plugins-marketing 1.0.0-beta.249 → 1.0.0-beta.252
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aglyn/plugins-marketing",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.252",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://aglyn.com",
|
|
6
6
|
"repository": {
|
|
@@ -25,21 +25,21 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aglyn/aglyn": "1.0.0-beta.
|
|
29
|
-
"@aglyn/shared-data-enums": "1.0.0-beta.
|
|
30
|
-
"@aglyn/shared-data-mdi": "1.0.0-beta.
|
|
31
|
-
"@aglyn/shared-ui-email-campaigns": "1.0.0-beta.
|
|
32
|
-
"@aglyn/shared-ui-jsx": "1.0.0-beta.
|
|
33
|
-
"@aglyn/shared-ui-jsx-forms": "1.0.0-beta.
|
|
34
|
-
"@aglyn/shared-ui-next": "1.0.0-beta.
|
|
35
|
-
"@aglyn/shared-ui-snackstack": "1.0.0-beta.
|
|
36
|
-
"@aglyn/shared-util-email": "1.0.0-beta.
|
|
37
|
-
"@aglyn/shared-util-http": "1.0.0-beta.
|
|
38
|
-
"@aglyn/shared-util-timestamp": "1.0.0-beta.
|
|
39
|
-
"@aglyn/shared-util-tools": "1.0.0-beta.
|
|
40
|
-
"@aglyn/tenant-data-admin": "1.0.0-beta.
|
|
41
|
-
"@aglyn/tenant-feature-instance": "1.0.0-beta.
|
|
42
|
-
"@aglyn/tenant-runtime": "1.0.0-beta.
|
|
28
|
+
"@aglyn/aglyn": "1.0.0-beta.252",
|
|
29
|
+
"@aglyn/shared-data-enums": "1.0.0-beta.252",
|
|
30
|
+
"@aglyn/shared-data-mdi": "1.0.0-beta.252",
|
|
31
|
+
"@aglyn/shared-ui-email-campaigns": "1.0.0-beta.252",
|
|
32
|
+
"@aglyn/shared-ui-jsx": "1.0.0-beta.252",
|
|
33
|
+
"@aglyn/shared-ui-jsx-forms": "1.0.0-beta.252",
|
|
34
|
+
"@aglyn/shared-ui-next": "1.0.0-beta.252",
|
|
35
|
+
"@aglyn/shared-ui-snackstack": "1.0.0-beta.252",
|
|
36
|
+
"@aglyn/shared-util-email": "1.0.0-beta.252",
|
|
37
|
+
"@aglyn/shared-util-http": "1.0.0-beta.252",
|
|
38
|
+
"@aglyn/shared-util-timestamp": "1.0.0-beta.252",
|
|
39
|
+
"@aglyn/shared-util-tools": "1.0.0-beta.252",
|
|
40
|
+
"@aglyn/tenant-data-admin": "1.0.0-beta.252",
|
|
41
|
+
"@aglyn/tenant-feature-instance": "1.0.0-beta.252",
|
|
42
|
+
"@aglyn/tenant-runtime": "1.0.0-beta.252",
|
|
43
43
|
"@swc/helpers": "0.5.23"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
@@ -24,6 +24,7 @@ import { readPluginRecordCard } from "@aglyn/aglyn/plugin-manager/plugin-record-
|
|
|
24
24
|
import { hostPublicOrigin } from "@aglyn/aglyn/server";
|
|
25
25
|
import { consentGroupForSite, orgDataCollectionForHost, orgDataQueryForHost, filterDeliverableRecipients, filterSendableForHost, filterTopicSendable, firebaseAdmin, getOrgForHost, meterHostEmail, claimOrgEmailSendBudget, orgCampaignEmailSendsForMonth, readEmailSendRateConfig, readEmailSendRateWindow, reconcileCampaignSendReservation, reserveCampaignEmailSends, resolveHostSendingIdentity } from "@aglyn/tenant-data-admin";
|
|
26
26
|
import { raiseOperatorAlert } from "@aglyn/tenant-data-admin/server/operator-alerts";
|
|
27
|
+
import { withContactConsentForRuleMembers } from "@aglyn/tenant-data-admin/server/consent-by-address";
|
|
27
28
|
import { MARKETING_REPUTATION_BREAKER } from "../constants/operator-alerts.js";
|
|
28
29
|
// The person behind an address, through the plugin that keeps people
|
|
29
30
|
// (AGL-3080): the sender never opens the record system's collections.
|
|
@@ -819,13 +820,22 @@ export async function performCampaignSend(options) {
|
|
|
819
820
|
listName = String((_get = (await listRef.get()).get('name')) != null ? _get : '');
|
|
820
821
|
const members = await sweepAudience(listRef.collection('members'));
|
|
821
822
|
audienceTruncated = members.truncated;
|
|
823
|
+
const ruleMembers = new Set();
|
|
822
824
|
recipients = members.docs.map((doc)=>{
|
|
823
825
|
var _doc_get;
|
|
824
826
|
const email = String((_doc_get = doc.get('email')) != null ? _doc_get : '');
|
|
825
827
|
collectName(email, doc.get('name'));
|
|
826
828
|
collectConsent(email, doc.data());
|
|
829
|
+
if (doc.get('via') === 'rule') ruleMembers.add(email.trim().toLowerCase());
|
|
827
830
|
return email;
|
|
828
831
|
});
|
|
832
|
+
/*
|
|
833
|
+
* A row a list RULE enrolled carries no basis of its own — matching a
|
|
834
|
+
* rule is not an opt-in, so the materializer never writes one — and the
|
|
835
|
+
* person's real basis is on their contact. Read there, for those rows
|
|
836
|
+
* only, or a live list fed by a sign-up form is an audience of nobody
|
|
837
|
+
* under the strict policy, opt-ins and all.
|
|
838
|
+
*/ await withContactConsentForRuleMembers(orgDataCollectionForHost(hostId, 'contacts'), consentGroup, consent, ruleMembers);
|
|
829
839
|
} else {
|
|
830
840
|
recipients = Array.isArray(options.emails) ? options.emails.map((value)=>String(value)) : [];
|
|
831
841
|
}
|