1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-25 06:17:50 +00:00
catalog/mail
ishani2412 c89d3965b7 Improve Readme.md
PR to improve the Readme.md migrating the install task URL from
master to v1beta1

Signed-off-by: ishani2412 <ishani.1613039@kiet.edu>
2020-06-02 09:03:51 +01:00
..
OWNERS Send email via SMTP server task 2020-02-17 04:03:58 -06:00
README.md Improve Readme.md 2020-06-02 09:03:51 +01:00
sendmail.yaml Port mail to v1beta1 🦇 2020-03-06 07:49:46 -06:00

Send a message via SMTP server

This task sends a simple email to receivers via SMTP server

Install the Task and create a secret

kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/v1beta1/mail/sendmail.yaml

Create a secret that has the SMTP server information

  • url: The IP address of the SMTP server

  • port: The port number of the SMTP server

  • user: User name for the SMTP server

  • password: Password for the SMTP server

  • tls: The tls enabled or not ("True" or "False")

Example server-secret.yaml

kind: Secret
apiVersion: v1
metadata:
  name: server-secret
stringData:
  url: "smtp.server.com"
  port: "25"
  user: "userid"
  password: "password"
  tls: "False"

Example kubectl command

kubectl apply -f server-secret.yam

Parameters

  • server: The name of the secret that has the SMTP server information

  • subject: Email subject (plain text)

  • body: Email body (plain text)

  • sender: Email sender email address

  • recipients: Email recipients email addresses (space delimited)

Usage

This TaskRun runs the Task to send an email to the receivers via the SMTP server.

apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  name: mail-taskrun
spec:
  params:
  - name: server
    value: server-secret
  - name: subject
    value: Hi, again!
  - name: body
    value: "Tekton email"
  - name: sender
    value: "<me@myserver.com>"
  - name: recipients
    value: "<him@hisserver.com> <her@herserver.com>"
  taskRef:
    name: sendmail