File tree Expand file tree Collapse file tree 5 files changed +23
-2
lines changed Expand file tree Collapse file tree 5 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ contributors:
35
35
- authorName : Chris Bianca
36
36
email : chris@csfrequency.com
37
37
url : https://github.com/chrisbianca
38
+ - authorName : Elliot Hesp
39
+ email : elliot@invertase.io
40
+ url : https://github.com/ehesp
38
41
39
42
resources :
40
43
- name : addUserToList
@@ -105,3 +108,19 @@ params:
105
108
Look for **Audience ID** (for example, `27735fc60a`).
106
109
example : 1ab2345c67
107
110
required : true
111
+
112
+ - param : MAILCHIMP_CONTACT_STATUS
113
+ type : select
114
+ label : Contact status
115
+ description : >-
116
+ When a new contact is added to the Mailchimp list/audience, what is their initial status?
117
+ `subscribed`: The contact has subscribed and can receive campaigns.
118
+ `pending`: A double opt-in confirmation email will be sent to the user. Once accepted they will be set to
119
+ `subscribed`.
120
+ options :
121
+ - label : Subscribed
122
+ value : subscribed
123
+ - label : Pending
124
+ value : pending
125
+ default : subscribed
126
+ required : true
Original file line number Diff line number Diff line change @@ -19,4 +19,5 @@ exports.default = {
19
19
location : process . env . LOCATION ,
20
20
mailchimpApiKey : process . env . MAILCHIMP_API_KEY ,
21
21
mailchimpAudienceId : process . env . MAILCHIMP_AUDIENCE_ID ,
22
+ mailchimpContactStatus : process . env . MAILCHIMP_CONTACT_STATUS ,
22
23
} ;
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ exports.addUserToList = functions.handler.auth.user.onCreate((user) => __awaiter
52
52
logs . userAdding ( uid , config_1 . default . mailchimpAudienceId ) ;
53
53
const results = yield mailchimp . post ( `/lists/${ config_1 . default . mailchimpAudienceId } /members` , {
54
54
email_address : email ,
55
- status : "subscribed" ,
55
+ status : config_1 . default . mailchimpContactStatus ,
56
56
} ) ;
57
57
logs . userAdded ( uid , config_1 . default . mailchimpAudienceId , results . id ) ;
58
58
logs . complete ( ) ;
Original file line number Diff line number Diff line change @@ -18,4 +18,5 @@ export default {
18
18
location : process . env . LOCATION ,
19
19
mailchimpApiKey : process . env . MAILCHIMP_API_KEY ,
20
20
mailchimpAudienceId : process . env . MAILCHIMP_AUDIENCE_ID ,
21
+ mailchimpContactStatus : process . env . MAILCHIMP_CONTACT_STATUS ,
21
22
} ;
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ export const addUserToList = functions.handler.auth.user.onCreate(
52
52
`/lists/${ config . mailchimpAudienceId } /members` ,
53
53
{
54
54
email_address : email ,
55
- status : "subscribed" ,
55
+ status : config . mailchimpContactStatus ,
56
56
}
57
57
) ;
58
58
logs . userAdded ( uid , config . mailchimpAudienceId , results . id ) ;
You can’t perform that action at this time.
0 commit comments