Azure Pipelines extension that will patch an existing SendGrid Template.
The parameters of the task are described bellow:
sendGridApiKey
: The Api key for SendGridtemplateFile
: The path to the template filetemplateId
: The matching SendGrid Template IdversionId
: The matching SendGrid Template Version Id
Use Environment variables that correspond with the above parameters.
TASK_SENDGRID_APIKEY
= sendGridApiKeyTASK_SENDGRID_TEMPFILE
= templateFileTASK_SENDGRID_TEMPID
= templateIdTASK_SENDGRID_VERID
= versionId
To run a test
run -> NPM test
trigger:
branches:
include:
- main
paths:
include: # Include!
- "sendgrid/*"
exclude:
- README.md
pool:
vmImage: ubuntu-latest
stages:
- stage: build
jobs:
- job:
steps:
- task: PublishPipelineArtifact@0
inputs:
artifactName: "sendgrid"
targetPath: "sendgrid"
- stage: deploy_dev
displayName: Deploy to SendGrid
dependsOn:
- build
variables:
- group: my-variables
jobs:
- deployment: deploy
environment: sendgrid-dev
strategy:
runOnce:
deploy:
steps:
- download: current
artifact: sendgrid
patterns: "**/*"
- task: sendgridtemplatedeploy@1
displayName: "Deploy Template1"
inputs:
sendGridApiKey: "$(sendgrid-api-key)"
templateFile: "$(Pipeline.Workspace)/sendgrid/template1.html"
templateId: "sendgrid-template1-id"
versionId: "sendgrid-template2-version-id"
- task: sendgridtemplatedeploy@1
displayName: "Deploy Template2"
inputs:
sendGridApiKey: "$(sendgrid-api-key)"
templateFile: "$(Pipeline.Workspace)/sendgrid/template2.html"
templateId: "sendgrid-template2-id"
versionId: "sendgrid-template2-version-id"