Get BrevoEmailCampaign - tsubotitsch/Brevo GitHub Wiki

Get-BrevoEmailCampaign

SYNOPSIS

Retrieves email campaigns based on specified filters.

SYNTAX

Get-BrevoEmailCampaign [[-id] <Int32[]>] [[-name] <String[]>] [[-type] <String>] [[-status] <String>]
 [[-statistics] <String>] [[-startDate] <String>] [[-endDate] <String>] [[-limit] <String>] [[-offset] <Int32>]
 [[-sort] <String>] [[-excludeHtmlContent] <Boolean>] [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

The Get-BrevoEmailCampaign function retrieves email campaigns from the Brevo API based on various optional filters such as type, status, statistics, date range, and more.

EXAMPLES

EXAMPLE 1

Get-BrevoEmailCampaign -type "classic" -status "sent" -startDate "2023-01-01T00:00:00.000Z" -endDate "2023-01-31T23:59:59.999Z"

Retrieves all classic email campaigns that were sent in January 2023.

EXAMPLE 2

Get-BrevoEmailCampaign -statistics "globalStats" -limit 10 -offset 0 -sort "asc"

Retrieves the first 10 email campaigns sorted in ascending order, including only global statistics.

PARAMETERS

-endDate

Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result. Only available if either 'status' is not passed or if passed is set to 'sent'.

Type: String
Parameter Sets: (All)
Aliases:

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

-excludeHtmlContent

Use this flag to exclude htmlContent from the response body. If set to true, htmlContent field will be returned as an empty string in the response body.

Type: Boolean
Parameter Sets: (All)
Aliases:

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

-id

The ID(s) of the specific campaign to retrieve. If not specified, all campaigns are retrieved.

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

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

-limit

Number of documents per page. Defaults to 50. Valid range is 0 to 100.

Type: String
Parameter Sets: (All)
Aliases:

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

-name

The name(s) of the specific campaign to retrieve. If not specified, all campaigns are retrieved.

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

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

-offset

Index of the first document in the page. Defaults to 0.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 9
Default value: 0
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

-sort

Sort the results in the ascending/descending order of record creation. Default order is descending if sort is not passed.

Type: String
Parameter Sets: (All)
Aliases:

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

-startDate

Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result. Only available if either 'status' is not passed or if passed is set to 'sent'.

Type: String
Parameter Sets: (All)
Aliases:

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

-statistics

Filter on the type of statistics required. Valid values are "globalStats", "linkStats", and "statsByDomain". This option only returns data for events occurred in the last 6 months.

Type: String
Parameter Sets: (All)
Aliases:

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

-status

Filter on the status of the campaign. Valid values are "suspended", "archive", "sent", "queued", "draft", and "inProgress".

Type: String
Parameter Sets: (All)
Aliases:

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

-type

Filter on the type of the campaigns. Valid values are "classic" and "trigger".

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
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

Returns the email campaigns that match the specified filters.

NOTES

RELATED LINKS

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