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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow include images on newsletters #4834

Open
decabeza opened this issue May 20, 2022 · 1 comment
Open

Allow include images on newsletters #4834

decabeza opened this issue May 20, 2022 · 1 comment
Labels

Comments

@decabeza
Copy link
Collaborator

Description

It would be nice to allow include images on newsletters sent from admin.

I've started a PR on another fork with the following changes, but I'm stuck on the last one: 馃槗

  1. Change the newsletters form adding the class "admin" on class: "html-area admin" %> to show the images button.

  2. Change the newsletter view so the images renders correctly, replacing:

<%= auto_link_already_sanitized_html wysiwyg(@newsletter.body) %> 

to:

<%= auto_link_already_sanitized_html AdminWYSIWYGSanitizer.new.sanitize(@newsletter.body) %> 
  1. Finally it would be necessary to change the path in ckEditor so that the image use an absolute path instead of a relative path so that they work from an external site, an email in this case.

In version 1.4.1. I could change the file ckeditor/picture.rb and add in URL the Setting["url"], something like:

url: "#{Setting["url"]}/ckeditor_assets/pictures/:id/:style_:basename.:extension

But I've seen that currently that file ckeditor/picture.rb is very different. 馃槄

Where could we change that URL value for ckEditor images? 馃

If someone helps me to solve my doubt 馃 I can send a PR to add this to CONSUL. 馃槍

@decabeza decabeza added the Admin label May 20, 2022
@javierm
Copy link
Member

javierm commented May 23, 2022

@decabeza I think adding "#{Setting["url"]}#{ to the beginning of the url_content method would solve the problem 馃. Absolute URLs and emails are tricky, so I'm not sure right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants