11import { ResendIcon } from '@/components/icons'
22import type { BlockConfig } from '@/blocks/types'
3+ import { AuthMode } from '@/blocks/types'
34
45export const ResendBlock : BlockConfig = {
56 type : 'resend' ,
@@ -11,23 +12,21 @@ export const ResendBlock: BlockConfig = {
1112 category : 'tools' ,
1213 bgColor : '#181C1E' ,
1314 icon : ResendIcon ,
15+ authMode : AuthMode . ApiKey ,
1416
1517 subBlocks : [
1618 {
1719 id : 'operation' ,
1820 title : 'Operation' ,
1921 type : 'dropdown' ,
2022 options : [
21- // Email Operations
2223 { label : 'Send Email' , id : 'send_email' } ,
2324 { label : 'Get Email' , id : 'get_email' } ,
24- // Contact Operations
2525 { label : 'Create Contact' , id : 'create_contact' } ,
2626 { label : 'List Contacts' , id : 'list_contacts' } ,
2727 { label : 'Get Contact' , id : 'get_contact' } ,
2828 { label : 'Update Contact' , id : 'update_contact' } ,
2929 { label : 'Delete Contact' , id : 'delete_contact' } ,
30- // Domain Operations
3130 { label : 'List Domains' , id : 'list_domains' } ,
3231 ] ,
3332 value : ( ) => 'send_email' ,
@@ -41,7 +40,6 @@ export const ResendBlock: BlockConfig = {
4140 password : true ,
4241 } ,
4342
44- // Send Email fields
4543 {
4644 id : 'fromAddress' ,
4745 title : 'From Address' ,
@@ -80,7 +78,7 @@ export const ResendBlock: BlockConfig = {
8078"Order confirmation" -> "Your Order #12345 is Confirmed"
8179"Newsletter about new features" -> "New Features You'll Love"
8280
83- Return ONLY the subject line - no explanations.` ,
81+ Return ONLY the subject line - no explanations, no extra text .` ,
8482 placeholder : 'Describe the email topic...' ,
8583 } ,
8684 } ,
@@ -100,7 +98,7 @@ Return ONLY the subject line - no explanations.`,
10098- Keep paragraphs short
10199- Include appropriate greeting and sign-off
102100
103- Return ONLY the email body - no explanations.` ,
101+ Return ONLY the email body - no explanations, no extra text .` ,
104102 placeholder : 'Describe the email content...' ,
105103 } ,
106104 } ,
@@ -114,44 +112,62 @@ Return ONLY the email body - no explanations.`,
114112 ] ,
115113 value : ( ) => 'text' ,
116114 condition : { field : 'operation' , value : 'send_email' } ,
115+ mode : 'advanced' ,
117116 } ,
118117 {
119118 id : 'cc' ,
120119 title : 'CC' ,
121120 type : 'short-input' ,
122121 placeholder : 'cc@example.com' ,
123122 condition : { field : 'operation' , value : 'send_email' } ,
123+ mode : 'advanced' ,
124124 } ,
125125 {
126126 id : 'bcc' ,
127127 title : 'BCC' ,
128128 type : 'short-input' ,
129129 placeholder : 'bcc@example.com' ,
130130 condition : { field : 'operation' , value : 'send_email' } ,
131+ mode : 'advanced' ,
131132 } ,
132133 {
133134 id : 'replyTo' ,
134135 title : 'Reply To' ,
135136 type : 'short-input' ,
136137 placeholder : 'reply@example.com' ,
137138 condition : { field : 'operation' , value : 'send_email' } ,
139+ mode : 'advanced' ,
138140 } ,
139141 {
140142 id : 'scheduledAt' ,
141143 title : 'Schedule At' ,
142144 type : 'short-input' ,
143145 placeholder : '2024-08-05T11:52:01.858Z' ,
144146 condition : { field : 'operation' , value : 'send_email' } ,
147+ mode : 'advanced' ,
148+ wandConfig : {
149+ enabled : true ,
150+ generationType : 'timestamp' ,
151+ prompt :
152+ 'Generate an ISO 8601 timestamp for scheduling email delivery. Return ONLY the timestamp - no explanations, no extra text.' ,
153+ placeholder : 'Describe when to send (e.g., "tomorrow at 9am")...' ,
154+ } ,
145155 } ,
146156 {
147157 id : 'tags' ,
148158 title : 'Tags' ,
149159 type : 'short-input' ,
150160 placeholder : 'category:welcome,type:onboarding' ,
151161 condition : { field : 'operation' , value : 'send_email' } ,
162+ mode : 'advanced' ,
163+ wandConfig : {
164+ enabled : true ,
165+ prompt :
166+ 'Generate comma-separated key:value pairs for email tags based on the description. Example format: "category:welcome,type:onboarding". Return ONLY the tag pairs - no explanations, no extra text.' ,
167+ placeholder : 'Describe the email tags...' ,
168+ } ,
152169 } ,
153170
154- // Get Email fields
155171 {
156172 id : 'emailId' ,
157173 title : 'Email ID' ,
@@ -161,7 +177,6 @@ Return ONLY the email body - no explanations.`,
161177 required : true ,
162178 } ,
163179
164- // Create Contact fields
165180 {
166181 id : 'email' ,
167182 title : 'Email' ,
@@ -196,7 +211,6 @@ Return ONLY the email body - no explanations.`,
196211 condition : { field : 'operation' , value : [ 'create_contact' , 'update_contact' ] } ,
197212 } ,
198213
199- // Get/Update/Delete Contact fields
200214 {
201215 id : 'contactId' ,
202216 title : 'Contact ID or Email' ,
@@ -239,7 +253,6 @@ Return ONLY the email body - no explanations.`,
239253 inputs : {
240254 operation : { type : 'string' , description : 'Operation to perform' } ,
241255 resendApiKey : { type : 'string' , description : 'Resend API key' } ,
242- // Send email inputs
243256 fromAddress : { type : 'string' , description : 'Email address to send from' } ,
244257 to : { type : 'string' , description : 'Recipient email address' } ,
245258 subject : { type : 'string' , description : 'Email subject' } ,
@@ -250,9 +263,7 @@ Return ONLY the email body - no explanations.`,
250263 replyTo : { type : 'string' , description : 'Reply-to email address' } ,
251264 scheduledAt : { type : 'string' , description : 'Scheduled send time in ISO 8601 format' } ,
252265 tags : { type : 'string' , description : 'Email tags as key:value pairs' } ,
253- // Get email inputs
254266 emailId : { type : 'string' , description : 'Email ID to retrieve' } ,
255- // Contact inputs
256267 email : { type : 'string' , description : 'Contact email address' } ,
257268 firstName : { type : 'string' , description : 'Contact first name' } ,
258269 lastName : { type : 'string' , description : 'Contact last name' } ,
@@ -262,24 +273,22 @@ Return ONLY the email body - no explanations.`,
262273
263274 outputs : {
264275 success : { type : 'boolean' , description : 'Operation success status' } ,
265- // Send email outputs
276+ id : { type : 'string' , description : 'Email or contact ID' } ,
266277 to : { type : 'string' , description : 'Recipient email address' } ,
267278 subject : { type : 'string' , description : 'Email subject' } ,
268279 body : { type : 'string' , description : 'Email body content' } ,
269- // Get email outputs
270- id : { type : 'string' , description : 'Email or contact ID' } ,
271280 from : { type : 'string' , description : 'Sender email address' } ,
272281 html : { type : 'string' , description : 'HTML email content' } ,
273282 text : { type : 'string' , description : 'Plain text email content' } ,
274283 lastEvent : { type : 'string' , description : 'Last event status' } ,
275284 createdAt : { type : 'string' , description : 'Creation timestamp' } ,
285+ scheduledAt : { type : 'string' , description : 'Scheduled send timestamp' } ,
276286 tags : { type : 'json' , description : 'Email tags as name-value pairs' } ,
277- // Contact outputs
278287 email : { type : 'string' , description : 'Contact email address' } ,
279288 firstName : { type : 'string' , description : 'Contact first name' } ,
280289 lastName : { type : 'string' , description : 'Contact last name' } ,
290+ unsubscribed : { type : 'boolean' , description : 'Whether the contact is unsubscribed' } ,
281291 contacts : { type : 'json' , description : 'Array of contacts' } ,
282- // Domain outputs
283292 domains : { type : 'json' , description : 'Array of domains' } ,
284293 hasMore : { type : 'boolean' , description : 'Whether more results are available' } ,
285294 deleted : { type : 'boolean' , description : 'Whether the resource was deleted' } ,
0 commit comments