Class UpdateEmailCampaignRequest
- Namespace
- Mailtrap.EmailCampaigns.Requests
- Assembly
- Mailtrap.Abstractions.dll
Request object for updating an email campaign.
The request body is sent flat (no envelope). All properties are optional -
only properties set on the request are sent and changed.
Only Draft campaigns can be updated.
public sealed record UpdateEmailCampaignRequest : IValidatable, IEquatable<UpdateEmailCampaignRequest>
- Inheritance
-
UpdateEmailCampaignRequest
- Implements
Properties
ContactListIds
Gets or sets the identifiers of the contact lists to send to.
Treated as the full set of included lists - lists not listed are removed.
Combine with ContactSegmentIds to target both.
[JsonPropertyName("contact_list_ids")]
[JsonPropertyOrder(9)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IList<long>? ContactListIds { get; set; }
Property Value
ContactSegmentIds
Gets or sets the identifiers of the contact segments to send to.
Treated as the full set of included segments.
[JsonPropertyName("contact_segment_ids")]
[JsonPropertyOrder(10)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IList<long>? ContactSegmentIds { get; set; }
Property Value
DeliveryMode
Gets or sets how the campaign is delivered.
[JsonPropertyName("delivery_mode")]
[JsonPropertyOrder(7)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public DeliveryMode? DeliveryMode { get; set; }
Property Value
- DeliveryMode
Delivery mode (Rapid or Gradual), or null to leave unchanged.
DeliveryOptions
Gets or sets the delivery throttling options. Applies when DeliveryMode is Gradual.
[JsonPropertyName("delivery_options")]
[JsonPropertyOrder(8)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public EmailCampaignDeliveryOptions? DeliveryOptions { get; set; }
Property Value
- EmailCampaignDeliveryOptions
Delivery throttling options, or null to leave unchanged.
DomainId
Gets or sets the identifier of the verified sending domain used for the campaign, as returned by the Sending Domains endpoints.
[JsonPropertyName("domain_id")]
[JsonPropertyOrder(2)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public long? DomainId { get; set; }
Property Value
FromDisplayName
Gets or sets the display name shown in the From header.
[JsonPropertyName("from_display_name")]
[JsonPropertyOrder(3)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? FromDisplayName { get; set; }
Property Value
FromLocalPart
Gets or sets the local part (before the @) of the From address.
[JsonPropertyName("from_local_part")]
[JsonPropertyOrder(4)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? FromLocalPart { get; set; }
Property Value
Name
Gets or sets the campaign name.
[JsonPropertyName("name")]
[JsonPropertyOrder(1)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Name { get; set; }
Property Value
ReplyTo
Gets or sets the Reply-To address parts.
[JsonPropertyName("reply_to")]
[JsonPropertyOrder(5)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ReplyTo? ReplyTo { get; set; }
Property Value
TemplateAttributes
Gets or sets the template attributes - the campaign's subject and design.
The campaign's template is always edited in place; only the provided sub-fields change.
[JsonPropertyName("template_attributes")]
[JsonPropertyOrder(6)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public EmailCampaignTemplateAttributes? TemplateAttributes { get; set; }
Property Value
- EmailCampaignTemplateAttributes
Template attributes, or null to leave unchanged.
Methods
Validate()
Validates the current instance.
public ValidationResult Validate()
Returns
- ValidationResult
Object containing validation errors, if any.