SendGrid Scaffolder Action logo

Backstage SendGrid Scaffolder Action Plugin

Created by CodeVerse-GP

SendGrid Scaffolder Action adds email to your Backstage templates. It lets a template send an email while the task runs. Use it to confirm a new service, share access details, request approval, or send a run summary. You control recipient, sender, subject, and body from the template. It supports plain text or HTML. The action runs inside the flow your team already uses. No new screens. No context switch.

This keeps communication close to the work. When a template provisions code or repos, it can notify the right people at the same time. That cuts manual follow ups after a run. It also helps teams standardize what gets sent and who gets the message. The output makes it easy to see that an email was triggered, which is useful for audits.

Engineers get one clear thing that does one job. Send an email through SendGrid during scaffolding. It fits the way Backstage actions work, so you can drop it into existing templates with minimal changes. If your company already uses SendGrid, this action ties into that choice and keeps everything in one place.

Installation Instructions

These instructions apply to self-hosted Backstage only.

Install for the new backend system

  1. Add the backend module
Copy
# From your Backstage root
yarn --cwd packages/backend add @codeverse-gp/scaffolder-backend-module-sendgrid
  1. Register the module in your backend
Copy
// packages/backend/src/index.ts
const backend = createBackend();

// other modules
backend.add(import('@backstage/plugin-scaffolder-backend'));

// sendgrid action module
backend.add(import('@codeverse-gp/scaffolder-backend-module-sendgrid'));
  1. Add SendGrid settings
Copy
# app-config.yaml
sendgrid:
  apiKey: API_KEY

You can also set defaults

Copy
# app-config.yaml
sendgrid:
  apiKey: API_KEY
  defaults:
    from: noreply@example.com
    subject: Default Subject
    body: "<p>This is the default email body.</p>"

No frontend import is needed. This module adds a Scaffolder action on the backend. You will use it in templates with the action id shown below.

Add a software template that uses the action

Place a template file in your repo. Example path

Copy
/catalog/templates/sendgrid-email-template.yaml

Register the template in your catalog config so Backstage can load it

Copy
# app-config.yaml
catalog:
  locations:
    - type: file
      target: ./catalog/templates/sendgrid-email-template.yaml

Option 1 pass all inputs in the template

Keep only the API key in your app config

Copy
# app-config.yaml
sendgrid:
  apiKey: API_KEY

Create the template

Copy
apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
  name: sendgrid-email-test
  title: Test SendGrid Email Action
  description: Template to test the custom SendGrid email scaffolder action
spec:
  owner: abc
  type: service

  parameters:
    - title: Basic Info
      required:
        - name
        - to
        - from
        - subject
        - body
      properties:
        name:
          title: Your Name
          type: string
          description: This will be included in the email.
        to:
          title: Email To
          type: string
          description: Recipient email address
        from:
          title: Email From
          type: string
          description: Sender email address (must be a verified sender in SendGrid)
        subject:
          title: Subject
          type: string
          default: "🎉 Hello from Backstage!"
        body:
          title: Email Body
          type: string
          default: "<p>This is a test email sent from Backstage using SendGrid.</p>"

  steps:
    - id: send-email
      name: Send Email
      action: sendgrid:email:send
      input:
        to: ${{ parameters.to }}
        from: ${{ parameters.from }}
        subject: ${{ parameters.subject }}
        body: |
          <h2>Hello ${{ parameters.name }}!</h2>
          ${{ parameters.body }}

  output:
    text:
      - title: ✅ Email Action Triggered
        content: |
          An email was sent to **${{ parameters.to }}** with the subject: _${{ parameters.subject }}_.

Option 2 use defaults from app config

Set defaults in your app config

Copy
# app-config.yaml
sendgrid:
  apiKey: API_KEY
  defaults:
    from: noreply@example.com
    subject: Default Subject
    body: "<p>This is the default email body.</p>"

Create the template

Copy
apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
  name: sendgrid-email-test
  title: Test SendGrid Email Action
  description: Template to test the custom SendGrid email scaffolder action
spec:
  owner: abc
  type: service

  parameters:
    - title: Basic Info
      required:
        - name
        - to
      properties:
        name:
          title: Your Name
          type: string
          description: This will be included in the email.
        to:
          title: Email To
          type: string
          description: Recipient email address

  steps:
    - id: send-email
      name: Send Email
      action: sendgrid:email:send
      input:
        to: ${{ parameters.to }}

  output:
    text:
      - title: ✅ Email Action Triggered
        content: |
          An email was sent to **${{ parameters.to }}** with the default subject and body.

You can review the action inputs on the actions page in your Backstage app at the path

Copy
/create/actions

Classic backend status

This package documents a module for the new backend system. It does not document a classic backend export. If your app still uses the classic backend you will need to migrate to the new backend to use this module.

Changelog

This changelog is produced from commits made to the SendGrid Scaffolder Action plugin since 6 months ago, and based on the code located here. It may not contain information about all commits. Releases and version bumps are intentionally omitted. This changelog is generated by AI.

Breaking changes

None

Documentation

  • Update README to improve clarity on SendGrid action usage. See #3. Merged 6 months ago

Community

  • Add a Code of Conduct. See #6. Merged 6 months ago
  • Add a project license. See #1. Merged 6 months ago

Build and CI

  • Add a TypeScript compilation step before running tests. See #4. Merged 6 months ago
  • Refactor workflow to combine build and publish steps in npm. See #2. Merged 6 months ago

Set up Backstage in minutes with Roadie