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

Email Publisher #123

Open
cybersecax opened this issue Feb 13, 2023 · 2 comments
Open

Email Publisher #123

cybersecax opened this issue Feb 13, 2023 · 2 comments

Comments

@cybersecax
Copy link

cybersecax commented Feb 13, 2023

When clicking on "Publish Product" and an email is sent through an email_publisher, the email contains just some information about the product. If it's a Vulnerability Report, for example, I can't see the vulnerability review text, the vulnerability name, the associated links and so on.

To get the desired info, I inserted the following in presenters/templates/pdf_body_template.html:

    <div>
    {% for news_item in report_item.news_items %}
    <h2 style="padding: 10px; background-color: #0689fe; color: white;">{{ news_item.title }}</h2>
    <h3>{{ news_item.author }}</h3>
    <h5 style="font-style:italic;color: #0689fe;">{{ news_item.link }}</h5>
    <h6 style="font-style:italic;">{{ news_item.published }}</h6>
    <p style="padding: 20px;">{{ news_item.review }}</p>
    {% endfor %}
    </div>

This will correct both the preview and the actual email content.
Obviously style settings need to go in the css file to have a cleaner code.

@milankowww
Copy link
Collaborator

Thank you for the coment. Could you please clarify? I understand that the pdf_body_template.html does not reference news items embedded in the report items, but when you put some report items into the product, these are all properly rendered. Is that what you mean?

If so, where did you put the news item details? They don't fit nicely into the current product template that we have, so perhaps you built on an older version?

Thinking about where to put the data: we could try to add it in the "LINKS" section, or perhaps make a second template so that the users can chose.

Looking forward for your thoughts on this.

@cybersecax
Copy link
Author

Like you understood, pdf_body_template.html does not reference news items embedded in the report items though they are properly rendered in the GUI.
I just modified src/presenters/templates/pdf_body_template.html like in the attached file.

As you said, It is not very nice but I'm still trying to figure out the best layout. I'm also trying to make the product's description appear as an introduction to the whole pdf: it would be nice but I didn't find the way to pass the information inside {{ data }} (I just found report_items in it).
pdf_body_template.html.txt

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

No branches or pull requests

2 participants