Skip to content

Send-GitLabMailMessage

SYNOPSIS

Send an email message with GitLab pipeline details.

SYNTAX

Send-GitLabMailMessage [-Body] <String> [[-Subject] <String>] [[-SMTPServer] <String>] [<CommonParameters>]

DESCRIPTION

This function generates an HTML email containing details about a GitLab pipeline, including project information, branch, commit details, and pipeline status. The email is sent to the GitLab user who triggered the pipeline.

EXAMPLES

EXAMPLE 1

Send-GitLabMailMessage -Body "Pipeline completed successfully." -Subject "Pipeline Success"

Sends an email with the subject "Pipeline Success" and the body "Pipeline completed successfully."

EXAMPLE 2

Send-GitLabMailMessage -Body "Pipeline failed due to an error." -Subject "Pipeline Failure" -SMTPServer "smtp.example.com"

Sends an email with the subject "Pipeline Failure" and the body "Pipeline failed due to an error" using the specified SMTP server.

PARAMETERS

-Body

The main content of the email message.

Type: String
Parameter Sets: (All)
Aliases:

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

-Subject

The subject of the email message. Default is "Information".

Type: String
Parameter Sets: (All)
Aliases:

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

-SMTPServer

The SMTP server used to send the email. Default is "smtp".

Type: String
Parameter Sets: (All)
Aliases:

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

NOTES