Skip to content

Create a SendGrid drip campaign #11

Description

@D-K-P

Description

Create a simple email drip campaign using SendGrid

The drip campaign should send a series of emails after a series of delays:

  • First email sent immediately on an eventTrigger
  • Second email sent 24 hours later
  • Third email sent 5 days later
  • Fourth email sent 30 days later

Use Zod to define the schema:

to: email-address
from: email-address
name: first-name / fall-back-name

Separate for each email:

subject: subject-text
text: email-text

Details:

Requirements:

  1. Follow this guide to get the project setup.

  2. Create a new file in the src folder, named appropriately.

  3. The Trigger.dev client must be defined at the top of the job, with the 'jobs-showcase' id:

const client = new TriggerClient({ id: "jobs-showcase" });
  1. You must add the Express specific lines to the bottom of the Job file:
// These lines can be removed if you don't want to use express
import { createExpressServer } from "@trigger.dev/express";
createExpressServer(client);
  1. You must add the new Job to the package.json file, in this format:
"scripts": {     
  //..other scripts
  "your-job-name": "nodemon --watch src/your-job-name.ts -r tsconfig-paths/register -r dotenv/config src/events.ts"   
} 

Important

You must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions