@@ -22,7 +22,7 @@ export const emailSequence = task({
2222 run : async (payload : { userId: string ; email: string ; name: string }) => {
2323 console .log (` Start email sequence for user ${payload .userId } ` , payload );
2424
25- // send the first email immediately
25+ // Send the first email immediately
2626 const firstEmailResult = await retry .onThrow (
2727 async ({ attempt }) => {
2828 const { data, error } = await resend .emails .send ({
@@ -33,7 +33,7 @@ export const emailSequence = task({
3333 });
3434
3535 if (error ) {
36- // throwing an error will trigger a retry of this block
36+ // Throwing an error will trigger a retry of this block
3737 throw error ;
3838 }
3939
@@ -42,10 +42,10 @@ export const emailSequence = task({
4242 { maxAttempts: 3 }
4343 );
4444
45- // then wait 3 days
45+ // Then wait 3 days
4646 await wait .for ({ days: 3 });
4747
48- // send the second email
48+ // Send the second email
4949 const secondEmailResult = await retry .onThrow (
5050 async ({ attempt }) => {
5151 const { data, error } = await resend .emails .send ({
@@ -56,7 +56,7 @@ export const emailSequence = task({
5656 });
5757
5858 if (error ) {
59- // throwing an error will trigger a retry of this block
59+ // Throwing an error will trigger a retry of this block
6060 throw error ;
6161 }
6262
@@ -70,15 +70,14 @@ export const emailSequence = task({
7070});
7171```
7272
73- ### Testing
73+ ## Testing your task
7474
75- To test this task, you can use the following payload:
75+ To test this task in the dashboard , you can use the following payload:
7676
7777``` json
7878{
7979 "userId" : " 123" ,
80- // Replace with your test email
81- "email" : " <your-test-email>" ,
80+ "email" : " <your-test-email>" , // Replace with your test email
8281 "name" : " Alice Testington"
8382}
8483```
0 commit comments