Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The code is displayed directly in the email template #347

Closed
widewebpro opened this issue Nov 30, 2022 · 8 comments
Closed

The code is displayed directly in the email template #347

widewebpro opened this issue Nov 30, 2022 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@widewebpro
Copy link

Steps to reproduce the issue:

  • send a test newsletter;

The JS code is displayed directly in the email template:

image

PHP version 8.0.25
OS version Linux 4.18.0-348.20.1.lve.1.el7h.x86_64
Database driver & version MySQL 10.6.11
Image driver & version GD 8.0.25
Craft edition & version Craft Pro 4.3.3
Yii version 2.0.46
Twig version v3.4.3
Guzzle version 7.5.0

Campaign 2.2.3

@widewebpro widewebpro added the bug Something isn't working label Nov 30, 2022
@bencroker
Copy link
Collaborator

Where exactly are you sending the test from, a campaign or a sendout? Please clear all caches in Craft to ensure this isn't coming from stale content.

@widewebpro
Copy link
Author

I cleared all cache.
image

@bencroker
Copy link
Collaborator

I'm not sure where this code is coming from – it's possible that a module/plugin is injecting it when it shouldn't be. Can you test this with a very simple HTML template, for example:

<!doctype html>
<html>
<head>
    <title>{{ campaign.title }}</title>
</head>
<body>
    Hello, {{ contact.email }}!
</body>
</html>

@widewebpro
Copy link
Author

Got the same result:

image

@bencroker
Copy link
Collaborator

Thanks for checking. It looks like your email client is not respecting <script> tags, but either way these should not be included in the template, I'll investigate further.

@bencroker
Copy link
Collaborator

I've fixed this for the upcoming 2.3.0 release. If you'd like to help test then you can change the putyourlightson/craft-campaign requirement in your project's composer.json file to "dev-develop as 2.3.0" and run composer update.

@bencroker bencroker self-assigned this Dec 2, 2022
@wmdhosting
Copy link

This works.. ok now on my side too

@bencroker
Copy link
Collaborator

Great! Released in version 2.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants