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

Allow use of variables in urls #49

Closed
Efocat opened this issue Jan 12, 2023 · 2 comments
Closed

Allow use of variables in urls #49

Efocat opened this issue Jan 12, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@Efocat
Copy link

Efocat commented Jan 12, 2023

It would be nice to expand the use of template string variables in urls for a catch all config

for example:

configs:
  # gmail pass-through
  "*@gmail.com":
    urls:
      - mailtos://user:password@gmail.com?from=${from}&to=${to}
    mailrise:
      title_template: "${subject}"

essentially this enables mailrise the ability to easily pass-through email to an external smtp server with a catch all

my use case is for Ombi where the system may send notification to multiple users using mailrise but some user only has email configured and it would be tedious to have individual entry for each of those user.

Version 1.3.0

@YoRyan YoRyan added the enhancement New feature or request label Jan 12, 2023
@YoRyan
Copy link
Owner

YoRyan commented Jan 12, 2023

This isn't trivial because Apprise isn't aware of the template string variables. We could expand them when passing the YAML configuration (which is just a string) to Apprise, but that could create weird conflicts if Apprise ever adds future URL formats that look like template strings.

Another problem is that Mailrise currently instantiates one Apprise configuration per notification target, on startup. If you're going to make the configuration depend on variables, you have to instantiate a new one each time you process a message.

You guys are coming up with some surprisingly complex configurations. I think the most general way to solve edge cases like this would be to make it possible to supply Python code to Mailrise to determine the processing logic. People who don't program can stick with the template strings and wildcards.

@YoRyan
Copy link
Owner

YoRyan commented Apr 15, 2023

Not keen on implementing this due to the aforementioned issues. But with b76b164, you can now build your own custom router to overcome the limitations of the template system.

@YoRyan YoRyan closed this as completed Apr 15, 2023
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