@social-mail/social-mail-web-server 1.5.91 → 1.5.92

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": "@social-mail/social-mail-web-server",
3
- "version": "1.5.91",
3
+ "version": "1.5.92",
4
4
  "description": "## Phase 1",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -148,6 +148,7 @@ export default class BroadcastEmail extends Workflow<IBroadcastEmail> {
148
148
  accessCode,
149
149
  from,
150
150
  to: [to],
151
+ modifyTo: true,
151
152
  host,
152
153
  }, {
153
154
  id: `bulk-dispatch-to-mx-${activityID}`,
@@ -39,6 +39,7 @@ interface IMessageEnvelope {
39
39
  host: string;
40
40
  from: string;
41
41
  to: string[];
42
+ modifyTo?: boolean;
42
43
  external: boolean;
43
44
  senderID?: number;
44
45
  activityID?: number;
@@ -91,8 +92,8 @@ export default class DispatchEmailToMX extends Workflow<IMessageEnvelope> {
91
92
  async signEmail(
92
93
  @Inject mds?: MailDispatcherService
93
94
  ) {
94
- const { emailID, senderID, activityID, emailAddressID, accessCode, external } = this.input;
95
- return await mds.encodeForBulk({ emailID, senderID, activityID, recipientID: emailAddressID, accessCode, external });
95
+ const { emailID, senderID, activityID, emailAddressID, accessCode, external, to } = this.input;
96
+ return await mds.encodeForBulk({ emailID, senderID, activityID, recipientID: emailAddressID, accessCode, external, to });
96
97
  }
97
98
 
98
99
  @UniqueActivity
@@ -39,8 +39,8 @@ export default class MailDispatcherService {
39
39
  @Inject
40
40
  cachedEmailService: CachedEmailService;
41
41
 
42
- async encodeForBulk({ senderID, emailID, recipientID, activityID, accessCode, external }:
43
- { senderID: number, emailID: number, recipientID: number, activityID: number, accessCode: string, external?: boolean }) {
42
+ async encodeForBulk({ senderID, emailID, recipientID, activityID, accessCode, external, to }:
43
+ { senderID: number, emailID: number, recipientID: number, activityID: number, accessCode: string, external?: boolean, to: string[] }) {
44
44
  const { db, tfs, storage, htmlSanitizer } = this;
45
45
  db.verifyFilters = false;
46
46
  db.raiseEvents = false;
@@ -76,7 +76,7 @@ export default class MailDispatcherService {
76
76
  .include((x) => x.emailAddress)
77
77
  .first();
78
78
 
79
- const to = email.recipients.map((r) => r.replyTo ?? r.emailAddress.emailAddress);
79
+ to ??= email.recipients.map((r) => r.replyTo ?? r.emailAddress.emailAddress);
80
80
 
81
81
  if (!email.senderName) {
82
82
  email.senderName = email.senderEmail.mailbox.emailAddress.name;