New Contact - tsubotitsch/Brevo GitHub Wiki

New-Contact

SYNOPSIS

Creates a new contact in Brevo with the specified details.

SYNTAX

New-Contact [-Email] <String> [[-ext_id] <String>] [[-ListIds] <Int32[]>] [[-attributes] <Object>]
 [-emailBlacklisted] [-smsBlacklisted] [-updateEnabled] [[-smtpBlacklistSender] <String[]>]
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

The `New-Contact` function allows you to create a new contact in Brevo by providing details such as email, list IDs, attributes, and other optional parameters. It supports updating an existing contact if the `-updateEnabled` switch is set.

EXAMPLES

EXAMPLE 1

# Create a new contact with mandatory and optional parameters
New-Contact -Email "[email protected]" -ListIds 1,2 -Attributes @{"FIRSTNAME"="John"; "LASTNAME"="Doe"} -updateEnabled

PARAMETERS

-attributes

A hashtable containing attributes and their values for the contact. The attributes should be passed in uppercase letters. Ensure the attributes exist in your Brevo account. For example: `-attributes @{"FIRSTNAME"="John"; "LASTNAME"="Doe"}`.

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Email

The email address of the contact. This parameter is mandatory.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-emailBlacklisted

A switch to blacklist the contact for emails. This parameter is optional.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-ext_id

An optional external ID to associate with the contact.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ListIds

The IDs of the contact list(s) to which the contact will be added. This parameter is optional.

Type: Int32[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-smsBlacklisted

A switch to blacklist the contact for SMS. This parameter is optional.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-smtpBlacklistSender

An array of transactional email forbidden senders for the contact. This is only applicable if `-updateEnabled:$true`.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-updateEnabled

A switch to enable updating an existing contact in the same request. Default is `$false`.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

The id of the created contact.

NOTES

RELATED LINKS

⚠️ **GitHub.com Fallback** ⚠️