Summary
Creates a new email template.
Add-EmailTemplate
-Entry
Returns an email template object.
Parameters
Parameter | Type | Required? | Notes |
---|---|---|---|
Entry | Email Template Object | Yes | The email template object to create as a new entry. |
Examples
Create a new email template
# Create a email template object with required fields
$entry = @{
Name = "Task Completed"
Template = "<p>Your task has been completed!</p>"
}
$createdEntry = Add-EmailTemplate -Entry $entry
# Output some information to help indicate that the template was created
Write-Output "Email template $($createdEntry.EmailTemplateId) ($($createdEntry.Name)) was created"
# For debug purposes, convert the data to output as JSON so we can see all the fields
Write-Output ""
Write-Output "JSON Results:"
$jsonOutput = $createdEntry | ConvertTo-Json -Depth 10
# Output the data
Write-Output $jsonOutput
Execution results:
Email template 9 (Task Completed) was created
JSON Results:
{
"EmailTemplateId": 9,
"Name": "Task Completed",
"Description": null,
"Subject": null,
"Template": "<p>Your task has been completed!</p>",
"IsEnabled": true,
"CreatedByFullName": "Max Miller",
"CreatedById": "510e109b-6ff5-4442-9670-cd5e3cd82a7a",
"CreatedOn": "2025-07-17T11:04:47.0728462+00:00",
"CreatedBy": null,
"LastUpdatedByFullName": "Max Miller",
"LastUpdatedById": "510e109b-6ff5-4442-9670-cd5e3cd82a7a",
"LastUpdatedOn": "2025-07-17T11:04:47.0728462+00:00",
"LastUpdatedBy": null,
"NumberOfAssociatedContacts": 0,
"AssociatedContacts": []
}