payload-plugin-newsletter 0.12.2 → 0.13.0

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.cjs CHANGED
@@ -3756,7 +3756,7 @@ var createBroadcastInlinePreviewField = () => {
3756
3756
  type: "ui",
3757
3757
  admin: {
3758
3758
  components: {
3759
- Field: "/src/components/Broadcasts/BroadcastInlinePreview"
3759
+ Field: "payload-plugin-newsletter/components#BroadcastInlinePreview"
3760
3760
  }
3761
3761
  }
3762
3762
  };
@@ -3772,32 +3772,60 @@ var createBroadcastsCollection = (pluginConfig) => {
3772
3772
  plural: "Broadcasts"
3773
3773
  },
3774
3774
  admin: {
3775
- useAsTitle: "subject",
3775
+ useAsTitle: "contentSection.subject",
3776
3776
  description: "Individual email campaigns sent to subscribers",
3777
- defaultColumns: ["subject", "status", "sentAt", "recipientCount", "actions"]
3777
+ defaultColumns: ["contentSection.subject", "status", "sentAt", "recipientCount", "actions"]
3778
3778
  },
3779
3779
  fields: [
3780
3780
  {
3781
- name: "subject",
3782
- type: "text",
3783
- required: true,
3784
- admin: {
3785
- description: "Email subject line"
3786
- }
3787
- },
3788
- {
3789
- name: "preheader",
3790
- type: "text",
3791
- admin: {
3792
- description: "Preview text shown in email clients"
3793
- }
3781
+ type: "row",
3782
+ fields: [
3783
+ {
3784
+ name: "contentSection",
3785
+ type: "group",
3786
+ label: false,
3787
+ admin: {
3788
+ width: "50%",
3789
+ style: {
3790
+ paddingRight: "1rem"
3791
+ }
3792
+ },
3793
+ fields: [
3794
+ {
3795
+ name: "subject",
3796
+ type: "text",
3797
+ required: true,
3798
+ admin: {
3799
+ description: "Email subject line"
3800
+ }
3801
+ },
3802
+ {
3803
+ name: "preheader",
3804
+ type: "text",
3805
+ admin: {
3806
+ description: "Preview text shown in email clients"
3807
+ }
3808
+ },
3809
+ createEmailContentField({
3810
+ admin: {
3811
+ description: "Email content"
3812
+ }
3813
+ })
3814
+ ]
3815
+ },
3816
+ {
3817
+ name: "previewSection",
3818
+ type: "group",
3819
+ label: false,
3820
+ admin: {
3821
+ width: "50%"
3822
+ },
3823
+ fields: [
3824
+ createBroadcastInlinePreviewField()
3825
+ ]
3826
+ }
3827
+ ]
3794
3828
  },
3795
- createEmailContentField({
3796
- admin: {
3797
- description: "Email content"
3798
- }
3799
- }),
3800
- createBroadcastInlinePreviewField(),
3801
3829
  {
3802
3830
  name: "status",
3803
3831
  type: "select",
@@ -3815,7 +3843,7 @@ var createBroadcastsCollection = (pluginConfig) => {
3815
3843
  admin: {
3816
3844
  readOnly: true,
3817
3845
  components: {
3818
- Cell: "/src/components/Broadcasts/StatusBadge"
3846
+ Cell: "payload-plugin-newsletter/components#StatusBadge"
3819
3847
  }
3820
3848
  }
3821
3849
  },
@@ -3959,8 +3987,8 @@ var createBroadcastsCollection = (pluginConfig) => {
3959
3987
  type: "ui",
3960
3988
  admin: {
3961
3989
  components: {
3962
- Cell: "/src/components/Broadcasts/ActionsCell",
3963
- Field: "/src/components/Broadcasts/EmptyField"
3990
+ Cell: "payload-plugin-newsletter/components#ActionsCell",
3991
+ Field: "payload-plugin-newsletter/components#EmptyField"
3964
3992
  },
3965
3993
  disableListColumn: false
3966
3994
  }
@@ -3979,12 +4007,12 @@ var createBroadcastsCollection = (pluginConfig) => {
3979
4007
  }
3980
4008
  const { BroadcastApiProvider: BroadcastApiProvider2 } = await Promise.resolve().then(() => (init_broadcast2(), broadcast_exports));
3981
4009
  const provider = new BroadcastApiProvider2(providerConfig);
3982
- const htmlContent = await convertToEmailSafeHtml(doc.content);
4010
+ const htmlContent = await convertToEmailSafeHtml(doc.contentSection?.content);
3983
4011
  const providerBroadcast = await provider.create({
3984
- name: doc.subject,
4012
+ name: doc.contentSection?.subject,
3985
4013
  // Use subject as name since we removed the name field
3986
- subject: doc.subject,
3987
- preheader: doc.preheader,
4014
+ subject: doc.contentSection?.subject,
4015
+ preheader: doc.contentSection?.preheader,
3988
4016
  content: htmlContent,
3989
4017
  trackOpens: doc.settings?.trackOpens,
3990
4018
  trackClicks: doc.settings?.trackClicks,
@@ -4028,13 +4056,13 @@ var createBroadcastsCollection = (pluginConfig) => {
4028
4056
  return data;
4029
4057
  }
4030
4058
  const updates = {};
4031
- if (data.subject !== originalDoc.subject) {
4032
- updates.name = data.subject;
4033
- updates.subject = data.subject;
4059
+ if (data.contentSection?.subject !== originalDoc.contentSection?.subject) {
4060
+ updates.name = data.contentSection?.subject;
4061
+ updates.subject = data.contentSection?.subject;
4034
4062
  }
4035
- if (data.preheader !== originalDoc.preheader) updates.preheader = data.preheader;
4036
- if (data.content !== originalDoc.content) {
4037
- updates.content = await convertToEmailSafeHtml(data.content);
4063
+ if (data.contentSection?.preheader !== originalDoc.contentSection?.preheader) updates.preheader = data.contentSection?.preheader;
4064
+ if (data.contentSection?.content !== originalDoc.contentSection?.content) {
4065
+ updates.content = await convertToEmailSafeHtml(data.contentSection?.content);
4038
4066
  }
4039
4067
  if (data.settings?.trackOpens !== originalDoc.settings?.trackOpens) {
4040
4068
  updates.trackOpens = data.settings.trackOpens;