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

Unable to use config value to set smtp_port in email action configuration #542

Open
thpiron opened this issue Nov 25, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@thpiron
Copy link

thpiron commented Nov 25, 2024

Describe the bug
When using the email builtin plugin (https://github.com/ovh/utask/blob/master/pkg/plugins/builtin/email/README.md), setting the port from a template evaluated value ( "{{ .config.smtp.port }}" for example) generate a validation error.

To Reproduce
Steps to reproduce the behavior:
Creating a template with an email action, using the example values from the documentation page.

action:
  type: email
  configuration:
    # optional, string, leave empty for no auth
    smtp_username: {{.config.smtp.username}}
    # optional, string, leave empty for no auth
    smtp_password: {{.config.smtp.password}}
    # mandatory, string as uint
    smtp_port: {{.config.smtp.port}}
    # mandatory, string
    smtp_hostname: {{.config.smtp.hostname}}
    # optional, string as boolean
    smtp_skip_tls_verify: "true"
    # mandatory, string
    from_address: [email protected]
    # optional, string
    from_name: uTask bot
    # mandatory, string collection
    to: [[email protected], [email protected]]
    # mandatory, string
    subject: Hello from µTask
    # mandatory, string
    body: |
      I love baguette

error: Invalid task template: Invalid step sendEmail: Invalid executor action: can't parse smtp_port field \"{{ .config.smtp.port }}\": strconv.ParseUint: parsing \"{{ .config.smtp.port }}\": invalid syntax

Expected behavior
Starts without errors, and validate smtp port using the evaluated value in template.

utask version impacted by the bug
v1.32.0

Context which you are currently running utask
docker

@thpiron thpiron added the bug Something isn't working label Nov 25, 2024
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

1 participant