@nextlyhq/plugin-form-builder 0.0.2-alpha.73 → 0.0.2-alpha.74

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/dist/index.js CHANGED
@@ -3063,16 +3063,19 @@ async function handleSubmissionCreated(context, config, nextly) {
3063
3063
  reason: skip.reason
3064
3064
  });
3065
3065
  if (emails.length === 0) return;
3066
- await sendNotificationEmails({
3067
- emails: await nextly.filters.apply("form-builder.beforeEmail", emails, {
3068
- form,
3069
- submission
3070
- }),
3066
+ const finalEmails = await nextly.filters.apply("form-builder.beforeEmail", emails, {
3067
+ form,
3068
+ submission
3069
+ });
3070
+ const send = () => sendNotificationEmails({
3071
+ emails: finalEmails,
3071
3072
  emailService,
3072
3073
  logger: nextly.logger,
3073
3074
  formSlug: form.slug,
3074
3075
  fileAttachments
3075
3076
  });
3077
+ const { afterCommit } = context;
3078
+ await (afterCommit ? afterCommit(send) : send());
3076
3079
  }
3077
3080
  /**
3078
3081
  * Send each notification, and log what happened to it.