File tree Expand file tree Collapse file tree 4 files changed +21
-2
lines changed
.github/actions/render-newsletter Expand file tree Collapse file tree 4 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ inputs:
22
22
sendgrid_list_id :
23
23
description : ' SendGrid contacts list to send the newsletter to'
24
24
required : false
25
+ sendgrid_sender_id :
26
+ description : ' Verified sender id'
27
+ required : false
25
28
suppression_group_id :
26
29
description : ' '
27
30
required : false
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ type Options = {
54
54
template ?: string ,
55
55
context ?: any ,
56
56
listId ?: string ,
57
+ senderId ?: number ,
57
58
suppressionGroupId ?: number ,
58
59
siteYaml ?: string ,
59
60
subject ?: string ,
@@ -291,6 +292,8 @@ async function runAction() {
291
292
const {
292
293
INPUT_SENDGRID_LIST_ID : listId ,
293
294
INPUT_SENDGRID_API_KEY : apiKey ,
295
+ INPUT_SENDGRID_SENDER_ID : senderId ,
296
+
294
297
INPUT_TEMPLATE_PATH : template ,
295
298
INPUT_TEXT_PATH : path ,
296
299
INPUT_CONTEXT : context ,
@@ -317,6 +320,7 @@ async function runAction() {
317
320
output : outPath ,
318
321
context : context ? JSON . parse ( context ) : { } ,
319
322
listId : listId ,
323
+ senderId : senderId ? parseInt ( senderId ) : undefined ,
320
324
suppressionGroupId : suppressionGroupId ? parseInt ( suppressionGroupId ) : undefined ,
321
325
siteYaml,
322
326
subject,
@@ -335,6 +339,7 @@ async function testRun() {
335
339
process . env [ 'INPUT_SUPPRESSION_GROUP_ID' ] = '17889' ;
336
340
process . env [ 'INPUT_SITE_YAML' ] = __dirname + '/../../../../_config.yml' ;
337
341
342
+
338
343
await runAction ( ) ;
339
344
}
340
345
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ const API_BASE = 'https://api.sendgrid.com/v3';
20
20
type SingleSendParams = {
21
21
html : string ,
22
22
listId : string ,
23
+ senderId ?: number ,
23
24
suppressionGroup : number ,
24
25
token : string ,
25
26
sendAt ?: Date ,
@@ -47,7 +48,8 @@ export async function singleSend(params: SingleSendParams) {
47
48
email_config : {
48
49
subject : params . subject ,
49
50
html_content : params . html ,
50
- suppression_group_id : params . suppressionGroup
51
+ suppression_group_id : params . suppressionGroup ,
52
+ sender_id : params . senderId || null ,
51
53
}
52
54
} )
53
55
} ) ;
@@ -143,3 +145,12 @@ export async function cleanup(params: GetSingleSendsParams) {
143
145
}
144
146
}
145
147
}
148
+
149
+ export async function verifiedSenders ( { token } : { token : string } ) {
150
+ return await fetch ( `${ API_BASE } /verified_senders` , {
151
+ method : 'GET' ,
152
+ headers : {
153
+ 'Authorization' : `Bearer ${ token } `
154
+ }
155
+ } ) ;
156
+ }
You can’t perform that action at this time.
0 commit comments