High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.
JavaScript campaigncampaign-managementemail-marketingemail-subscriptionlistmonkmailing-listnewsletternewsletter-managementnewsletter-softwareself-hostedsms-gatewaysmtptransactional-emails
Default `body_source` to null instead of empty string in non-visual campaigns.
Kailash Nadh47e8f8164f11
diff --git a/cmd/campaigns.go b/cmd/campaigns.goindex 09993fff..feb606a5 100644--- a/cmd/campaigns.go+++ b/cmd/campaigns.go@@ -611,6 +611,9 @@ func (a *App) validateCampaignFields(c campReq) (campReq, error) {c.ContentType != models.CampaignContentTypeVisual &&c.ContentType != models.CampaignContentTypeMarkdown {c.ContentType = models.CampaignContentTypeRichtext+ }++ if c.ContentType != models.CampaignContentTypeVisual {c.BodySource.Valid = false}diff --git a/queries.sql b/queries.sqlindex e24755b8..2baf70b0 100644--- a/queries.sql+++ b/queries.sql@@ -509,7 +509,7 @@ WITH tpl AS (-- HTML template body "import" during creation.(CASE WHEN type = 'campaign_visual' THEN NULL ELSE id END) AS id,(CASE WHEN type = 'campaign_visual' THEN body ELSE '' END) AS body,- (CASE WHEN type = 'campaign_visual' THEN body_source ELSE '' END) AS body_source,+ (CASE WHEN type = 'campaign_visual' THEN body_source ELSE NULL END) AS body_source,(CASE WHEN type = 'campaign_visual' THEN 'visual' ELSE 'richtext' END) AS content_typeFROM templatesWHERE