Sends an email or SMS message using Twilio.
An example workflow of using the container in a workflow on Direktiv.
id: send-approval
functions:
- id: send
image: vorteil/twilio
description: "Sends a sms to provided number"
states:
- id: fire
type: action
action:
secrets: ["TWILIO_TOKEN", "TWILIO_SID", "TWILIO_PROVIDED_NUMBER"]
function: send
input: '{ "typeof": "sms",
"sid": .secrets.TWILIO_SID,
"token": .secrets.TWILIO_TOKEN,
"message": "A fun SMS message!",
"from": .secrets.TWILIO_PROVIDED_NUMBER,
"to": ("+" + (.number|tostring))}'
token, to, and from fields appropriately. {
"typeof" : "email",
"token" : "TOKEN_STIRNG",
"subject" : "Subject Header of Email",
"message" : "Normal string message",
"htmlMessage" : "<html><body><h5>HI</h5></body></html",
"from" : "[email protected]",
"to" : "[email protected]"
}
message field and ensure that htmlMessage is unused. In the event that both message and htmlMessage are populated, the htmlMessage takes precedence. {
"typeof" : "sms",
"sid" : "TWILIO_SID",
"token" : "TWILIO_TOKEN",
"message" : "RECIPIENT_NAME",
"from" : "TWILIO_FROM_NUM",
"to" : "RECIPIENT_NUM"
}
No output is returned upon success. In the case that an error is encountered, it will present in the following format:
{
"errorCode" : "com.request.error",
"errorMsg" : "Something went wrong"
}
Content type
Image
Digest
Size
2 MB
Last updated
over 5 years ago
docker pull jkizo/twilio