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

Filtering options #1

Closed
murmelbahn opened this issue Jul 8, 2021 · 4 comments
Closed

Filtering options #1

murmelbahn opened this issue Jul 8, 2021 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@murmelbahn
Copy link

Hi,
really great project!

I have some applications which sends HTML encoded mails to mailrise.
Sadly matrix is not able to output the content correct. So I get some random gibbish in the notification.

Would it be possible to only pass through the subject of the mail? Most of the informations are in there so
it's okay when i don't get the body of the message. I think this solution is way easier then removing the HTML content.

@YoRyan YoRyan added the enhancement New feature or request label Jul 8, 2021
@YoRyan YoRyan self-assigned this Jul 8, 2021
@YoRyan
Copy link
Owner

YoRyan commented Jul 8, 2021

I'm curious: How badly does Matrix mangle the HTML? I wonder if it merits filing an upstream bug with Apprise.

As to filtering content, I have a more general solution in mind. How about allowing users to specify template strings to construct the title and body with? This is how they would look assuming the current behavior:

configs:
  my_matrix:
    urls:
      - matrix://whatever
    mailrise:
      title_template: "$subject ($from)"
      body_template: "$content"

In your case, you could specify body_template: "" to suppress the body. I'm thinking it could also be useful to have a $content_plain variable that would strip any HTML markup.

@murmelbahn
Copy link
Author

Hi,
as you can see in the wiki of apprise, matrix is only capable of plain text messages:
https://github.com/caronc/apprise/wiki/Notify_matrix

So you see the whole HTML code in the message mailrise is forwarding.

The solution by using template strings would be nice. Stripping the HTML markup is unnecessary I think. If you have some really fancy HTML mail, the stripping would not be able to make the mail/message readable.

@YoRyan
Copy link
Owner

YoRyan commented Jul 13, 2021

According to the developer docs, Apprise is supposed to "do the right thing" if it receives HTML or Markdown for a service that only supports plain text:

Developers should know that Apprise passes everything it gets as is which will work for most circumstances. However sometimes it's useful to let apprise know the data you're feeding it. This information is used to guarantee that the upstream provider can handle the content, and if it can't, it will be modified so that it does.

In my opinion that should include stripping any markup, but Apprise clearly isn't doing that for us. 🤷 I'll leave it to upstream to implement that if there is demand for it.

@YoRyan YoRyan closed this as completed in c54e553 Jul 14, 2021
@YoRyan
Copy link
Owner

YoRyan commented Jul 14, 2021

Template strings are now implemented and documented!

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

No branches or pull requests

2 participants