2020-10-13 01:48:20 -07:00
import {
INodeProperties ,
} from 'n8n-workflow' ;
2021-12-03 00:44:16 -08:00
export const subscriberOperations : INodeProperties [ ] = [
2020-10-13 01:48:20 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-10-13 01:48:20 -07:00
displayOptions : {
show : {
resource : [
'subscriber' ,
] ,
} ,
} ,
options : [
{
name : 'Add' ,
value : 'add' ,
description : 'Add a subscriber to a list' ,
2022-07-10 13:50:51 -07:00
action : 'Add a subscriber' ,
2020-10-13 01:48:20 -07:00
} ,
{
name : 'Count' ,
value : 'count' ,
description : 'Count subscribers' ,
2022-07-10 13:50:51 -07:00
action : 'Count a subscriber' ,
2020-10-13 01:48:20 -07:00
} ,
{
name : 'Delete' ,
value : 'delete' ,
description : 'Delete a subscriber from a list' ,
2022-07-10 13:50:51 -07:00
action : 'Delete a subscriber' ,
2020-10-13 01:48:20 -07:00
} ,
{
name : 'Remove' ,
value : 'remove' ,
description : 'Unsubscribe user from a list' ,
2022-07-10 13:50:51 -07:00
action : 'Remove a subscriber' ,
2020-10-13 01:48:20 -07:00
} ,
{
name : 'Status' ,
value : 'status' ,
description : 'Get the status of subscriber' ,
2022-07-10 13:50:51 -07:00
action : 'Get subscriber\'s status' ,
2020-10-13 01:48:20 -07:00
} ,
] ,
default : 'add' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-10-13 01:48:20 -07:00
2021-12-03 00:44:16 -08:00
export const subscriberFields : INodeProperties [ ] = [
2020-10-13 01:48:20 -07:00
/* -------------------------------------------------------------------------- */
/* subscriber:add */
/* -------------------------------------------------------------------------- */
{
displayName : 'Email' ,
name : 'email' ,
type : 'string' ,
2022-06-20 07:54:01 -07:00
placeholder : 'name@email.com' ,
2020-10-13 01:48:20 -07:00
displayOptions : {
show : {
resource : [
'subscriber' ,
] ,
operation : [
'add' ,
] ,
} ,
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Email address of the subscriber' ,
2020-10-13 01:48:20 -07:00
} ,
{
displayName : 'List ID' ,
name : 'listId' ,
type : 'string' ,
displayOptions : {
show : {
resource : [
'subscriber' ,
] ,
operation : [
'add' ,
] ,
} ,
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The list ID you want to subscribe a user to. This encrypted & hashed ID can be found under View all lists section named ID.' ,
2020-10-13 01:48:20 -07:00
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
resource : [
'subscriber' ,
] ,
operation : [
'add' ,
] ,
} ,
} ,
options : [
{
displayName : 'Country' ,
name : 'country' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'User\'s 2 letter country code' ,
2020-10-13 01:48:20 -07:00
} ,
{
2020-10-13 01:48:46 -07:00
displayName : 'GDPR' ,
2020-10-13 01:48:20 -07:00
name : 'gdpr' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
description : 'Whether you\'re signing up EU users in a GDPR compliant manner' ,
2020-10-13 01:48:20 -07:00
} ,
{
displayName : 'Honeypot' ,
name : 'hp' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
// eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether
2022-05-06 14:01:25 -07:00
description : 'Include this \'honeypot\' field to prevent spambots from signing up via this API call. When spambots fills in this field, this API call will exit, preventing them from signing up fake addresses to your form. This parameter is only supported in Sendy 3.0 onwards.' ,
2020-10-13 01:48:20 -07:00
} ,
{
displayName : 'IP Address' ,
name : 'ipaddress' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'User\'s IP address' ,
2020-10-13 01:48:20 -07:00
} ,
{
displayName : 'Name' ,
name : 'name' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'User\'s name' ,
2020-10-13 01:48:20 -07:00
} ,
{
displayName : 'Referrer' ,
name : 'referrer' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The URL where the user signed up from' ,
2020-10-13 01:48:20 -07:00
} ,
{
displayName : 'Silent' ,
name : 'silent' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
// eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether
2022-05-06 14:01:25 -07:00
description : 'Set to "true" if your list is \'Double opt-in\' but you want to bypass that and signup the user to the list as \'Single Opt-in instead\' (optional)' ,
2020-10-13 01:48:20 -07:00
} ,
] ,
} ,
/* -------------------------------------------------------------------------- */
/* subscriber:count */
/* -------------------------------------------------------------------------- */
{
displayName : 'List ID' ,
name : 'listId' ,
type : 'string' ,
displayOptions : {
show : {
resource : [
'subscriber' ,
] ,
operation : [
'count' ,
] ,
} ,
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The list ID you want to subscribe a user to. This encrypted & hashed ID can be found under View all lists section named ID.' ,
2020-10-13 01:48:20 -07:00
} ,
/* -------------------------------------------------------------------------- */
/* subscriber:delete */
/* -------------------------------------------------------------------------- */
{
displayName : 'Email' ,
name : 'email' ,
type : 'string' ,
2022-06-20 07:54:01 -07:00
placeholder : 'name@email.com' ,
2020-10-13 01:48:20 -07:00
displayOptions : {
show : {
resource : [
'subscriber' ,
] ,
operation : [
'delete' ,
] ,
} ,
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Email address of the subscriber' ,
2020-10-13 01:48:20 -07:00
} ,
{
displayName : 'List ID' ,
name : 'listId' ,
type : 'string' ,
displayOptions : {
show : {
resource : [
'subscriber' ,
] ,
operation : [
'delete' ,
] ,
} ,
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The list ID you want to subscribe a user to. This encrypted & hashed ID can be found under View all lists section named ID.' ,
2020-10-13 01:48:20 -07:00
} ,
/* -------------------------------------------------------------------------- */
/* subscriber:remove */
/* -------------------------------------------------------------------------- */
{
displayName : 'Email' ,
name : 'email' ,
type : 'string' ,
2022-06-20 07:54:01 -07:00
placeholder : 'name@email.com' ,
2020-10-13 01:48:20 -07:00
displayOptions : {
show : {
resource : [
'subscriber' ,
] ,
operation : [
'remove' ,
] ,
} ,
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Email address of the subscriber' ,
2020-10-13 01:48:20 -07:00
} ,
{
displayName : 'List ID' ,
name : 'listId' ,
type : 'string' ,
displayOptions : {
show : {
resource : [
'subscriber' ,
] ,
operation : [
'remove' ,
] ,
} ,
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The list ID you want to subscribe a user to. This encrypted & hashed ID can be found under View all lists section named ID.' ,
2020-10-13 01:48:20 -07:00
} ,
/* -------------------------------------------------------------------------- */
/* subscriber:status */
/* -------------------------------------------------------------------------- */
{
displayName : 'Email' ,
name : 'email' ,
type : 'string' ,
2022-06-20 07:54:01 -07:00
placeholder : 'name@email.com' ,
2020-10-13 01:48:20 -07:00
displayOptions : {
show : {
resource : [
'subscriber' ,
] ,
operation : [
'status' ,
] ,
} ,
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Email address of the subscriber' ,
2020-10-13 01:48:20 -07:00
} ,
{
displayName : 'List ID' ,
name : 'listId' ,
type : 'string' ,
displayOptions : {
show : {
resource : [
'subscriber' ,
] ,
operation : [
'status' ,
] ,
} ,
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The list ID you want to subscribe a user to. This encrypted & hashed ID can be found under View all lists section named ID.' ,
2020-10-13 01:48:20 -07:00
} ,
2021-12-03 00:44:16 -08:00
] ;