Skip to content

Commit

Permalink
Fix archive template selection in campaign creation query.
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Nov 10, 2022
1 parent 56a9836 commit eaaca05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion queries.sql
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ counts AS (
),
camp AS (
INSERT INTO campaigns (uuid, type, name, subject, from_email, body, altbody, content_type, send_at, headers, tags, messenger, template_id, to_send, max_subscriber_id, archive, archive_template_id, archive_meta)
SELECT $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, (SELECT id FROM tpl), (SELECT to_send FROM counts), (SELECT max_sub_id FROM counts), $15, $16, $17
SELECT $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, (SELECT id FROM tpl), (SELECT to_send FROM counts), (SELECT max_sub_id FROM counts), $15, (CASE WHEN $16 = 0 THEN (SELECT id FROM tpl) ELSE $16 END), $17
RETURNING id
)
INSERT INTO campaign_lists (campaign_id, list_id, list_name)
Expand Down

0 comments on commit eaaca05

Please sign in to comment.