diff --git a/client/src/campaigns/Status.js b/client/src/campaigns/Status.js index 6cfd8b92..ef1c9617 100644 --- a/client/src/campaigns/Status.js +++ b/client/src/campaigns/Status.js @@ -72,7 +72,7 @@ class PreviewForTestUserModalDialog extends Component { }); const accessToken = result.data; - window.open(getSandboxUrl(`campaigns/rss-preview/${campaignCid}/${listCid}/${subscriptionCid}`, accessToken, {withLocale: true}), '_blank'); + window.open(getSandboxUrl(`cpgs/rss-preview/${campaignCid}/${listCid}/${subscriptionCid}`, accessToken, {withLocale: true}), '_blank'); } else if (entity.type === CampaignType.REGULAR) { window.open(getPublicUrl(`archive/${campaignCid}/${listCid}/${subscriptionCid}`, {withLocale: true}), '_blank'); diff --git a/locales/en-US/common.json b/locales/en-US/common.json index 6428b301..fa23af49 100644 --- a/locales/en-US/common.json +++ b/locales/en-US/common.json @@ -157,7 +157,7 @@ "campaign_plural": "Campaigns", "contentOfTheSelectedCampaignWillBeCopied": "Content of the selected campaign will be copied into this campaign.", "renderUrl": "Render URL", - "ifAMessageIsSentThenThisUrlWillBePosTed": "If a message is sent then this URL will be POSTed to using Merge Tags as POST body. Use this if you want to generate the HTML message yourself.", + "ifAMessageIsSentThenThisUrlWillBePosTed": "If a message is sent then this URL will be POSTed to using Merge Tags as POST body. Use this if you want to generate the HTML message yourself. Example: http://www.example.com/foo", "deletingCampaign": "Deleting campaign ...", "campaignDeleted": "Campaign deleted", "formCannotBeEditedBecauseTheCampaignIs": "Form cannot be edited because the campaign is currently being sent out. Wait till the sending is finished and refresh.", diff --git a/server/app-builder.js b/server/app-builder.js index c2a285a6..a6c1a984 100644 --- a/server/app-builder.js +++ b/server/app-builder.js @@ -275,7 +275,7 @@ async function createApp(appType) { useWith404Fallback('/files', files); } - useWith404Fallback('/campaigns', await campaigns.getRouter(appType)); + useWith404Fallback('/cpgs', await campaigns.getRouter(appType)); // This needs to be different from "campaigns", which is already used by the UI useWith404Fallback('/mosaico', await sandboxedMosaico.getRouter(appType)); useWith404Fallback('/ckeditor', await sandboxedCKEditor.getRouter(appType)); diff --git a/server/lib/message-sender.js b/server/lib/message-sender.js index fa5abfa7..ec26d3e0 100644 --- a/server/lib/message-sender.js +++ b/server/lib/message-sender.js @@ -200,14 +200,16 @@ class MessageSender { form[key] = mergeTags[key]; } + const sourceUrl = campaign.data.sourceUrl; + const response = await request.post({ - uri: campaign.sourceUrl, + uri: sourceUrl, form, resolveWithFullResponse: true }); if (response.statusCode !== 200) { - throw new Error(`Received status code ${httpResponse.statusCode} from ${campaign.sourceUrl}`); + throw new Error(`Received status code ${httpResponse.statusCode} from ${sourceUrl}`); } html = response.body;