Show / Hide Table of Contents

Interface IMarketingAgent

Interface for the Marketing Agent Agent used for Marketing functions, such as Forms

Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
[Agent("Marketing Agent", "Interface for the Marketing Agent. Agent used for Marketing functions, such as Forms")]
public interface IMarketingAgent : IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;

using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
   using (MarketingAgent agent = new MarketingAgent())
   {
      // call methods on agent here...
   }
}

Methods

CalculateMailingStatisticsAsync(int, CancellationToken)

Calculate open and click rates for one or more mailings

Declaration
Task<int> CalculateMailingStatisticsAsync(int shipmentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int shipmentId

If 0, calculate rates for all dirty (are_statistics_dirty) shipments

CancellationToken cancellationToken
Returns
Type Description
Task<int>

Number of shipments updated with calculated statistics

CreateDefaultFormEntityAsync(CancellationToken)

Loading default values into a new FormEntity. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance

Declaration
Task<FormEntity> CreateDefaultFormEntityAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<FormEntity>

New FormEntity with default values

CreateDefaultFormSubmissionEntityAsync(CancellationToken)

Loading default values into a new FormSubmissionEntity. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance

Declaration
Task<FormSubmissionEntity> CreateDefaultFormSubmissionEntityAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<FormSubmissionEntity>

New FormSubmissionEntity with default values

CreateDefaultShipmentMessageBlockEntityAsync(CancellationToken)

Loading default values into a new ShipmentMessageBlockEntity. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance

Declaration
Task<ShipmentMessageBlockEntity> CreateDefaultShipmentMessageBlockEntityAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<ShipmentMessageBlockEntity>

New ShipmentMessageBlockEntity with default values

CreateDefaultShipmentMessageEntityAsync(CancellationToken)

Loading default values into a new ShipmentMessageEntity. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance

Declaration
Task<ShipmentMessageEntity> CreateDefaultShipmentMessageEntityAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<ShipmentMessageEntity>

New ShipmentMessageEntity with default values

DeleteFormEntityAsync(int, CancellationToken)

Deletes the FormEntity

Declaration
Task DeleteFormEntityAsync(int formEntityId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int formEntityId

The identity of the FormEntity

CancellationToken cancellationToken
Returns
Type Description
Task

DeleteFormSubmissionEntityAsync(int, CancellationToken)

Deletes the FormSubmissionEntity

Declaration
Task DeleteFormSubmissionEntityAsync(int formSubmissionEntityId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int formSubmissionEntityId

The identity of the FormSubmissionEntity

CancellationToken cancellationToken
Returns
Type Description
Task

DeleteMessageAndShipmentAsync(int, CancellationToken)

Delete the message and the shipment the message (MessageId) belongs to

Declaration
Task DeleteMessageAndShipmentAsync(int messageId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int messageId

Message id

CancellationToken cancellationToken
Returns
Type Description
Task

DeleteShipmentMessageBlockEntityAsync(int, CancellationToken)

Deletes the ShipmentMessageBlockEntity

Declaration
Task DeleteShipmentMessageBlockEntityAsync(int shipmentMessageBlockEntityId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int shipmentMessageBlockEntityId

The identity of the ShipmentMessageBlockEntity

CancellationToken cancellationToken
Returns
Type Description
Task

DeleteShipmentMessageEntityAsync(int, CancellationToken)

Deletes the ShipmentMessageEntity

Declaration
Task DeleteShipmentMessageEntityAsync(int shipmentMessageEntityId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int shipmentMessageEntityId

The identity of the ShipmentMessageEntity

CancellationToken cancellationToken
Returns
Type Description
Task

GetFormEntityAsync(int, CancellationToken)

Gets a FormEntity object.

Declaration
Task<FormEntity> GetFormEntityAsync(int formEntityId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int formEntityId

The identifier of the FormEntity object

CancellationToken cancellationToken
Returns
Type Description
Task<FormEntity>

FormEntity

GetFormSubmissionEntityAsync(int, CancellationToken)

Gets a FormSubmissionEntity object.

Declaration
Task<FormSubmissionEntity> GetFormSubmissionEntityAsync(int formSubmissionEntityId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int formSubmissionEntityId

The identifier of the FormSubmissionEntity object

CancellationToken cancellationToken
Returns
Type Description
Task<FormSubmissionEntity>

FormSubmissionEntity

GetFormSubmissionsCountAsync(int, FormSubmissionStatus, CancellationToken)

Get counnt of submissions for given form and status. Count for all forms is returned if negative formId is given

Declaration
Task<int> GetFormSubmissionsCountAsync(int formId, FormSubmissionStatus status, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int formId

If 0 or less, return count for all forms

FormSubmissionStatus status

Which status the submissions should have. If Unknown, return count of all statuses

CancellationToken cancellationToken
Returns
Type Description
Task<int>

Number of formsubmissions

GetPreviewMailingAsync(int, CancellationToken)

Get a shipment message from its shipment address id

Declaration
Task<PreviewMailing> GetPreviewMailingAsync(int shipmentAddrId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int shipmentAddrId

Shipment address id

CancellationToken cancellationToken
Returns
Type Description
Task<PreviewMailing>

PreviewMailing

GetPreviewMailingHeaderAsync(int, CancellationToken)

Get a shipment from its shipment id

Declaration
Task<PreviewMailingHeader> GetPreviewMailingHeaderAsync(int shipmentId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int shipmentId

Shipment id

CancellationToken cancellationToken
Returns
Type Description
Task<PreviewMailingHeader>

PreviewMailingHeader

GetShipmentMessageBlockEntityAsync(int, CancellationToken)

Gets a ShipmentMessageBlockEntity object.

Declaration
Task<ShipmentMessageBlockEntity> GetShipmentMessageBlockEntityAsync(int shipmentMessageBlockEntityId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int shipmentMessageBlockEntityId

The identifier of the ShipmentMessageBlockEntity object

CancellationToken cancellationToken
Returns
Type Description
Task<ShipmentMessageBlockEntity>

ShipmentMessageBlockEntity

GetShipmentMessageEntityAsync(int, CancellationToken)

Gets a ShipmentMessageEntity object.

Declaration
Task<ShipmentMessageEntity> GetShipmentMessageEntityAsync(int shipmentMessageEntityId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int shipmentMessageEntityId

The identifier of the ShipmentMessageEntity object

CancellationToken cancellationToken
Returns
Type Description
Task<ShipmentMessageEntity>

ShipmentMessageEntity

GetUserBlocksAsync(int, CancellationToken)

Get the saved user blocks to be used in a shipment/mailing message

Declaration
Task<ShipmentMessageBlockEntity[]> GetUserBlocksAsync(int associateId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int associateId

The associate id to get the user blocks. 0 will get all saved blocks

CancellationToken cancellationToken
Returns
Type Description
Task<ShipmentMessageBlockEntity[]>

An array of user blocks

RenameMailingByMessageIdAsync(int, string, CancellationToken)

Change the mailing name (shipment description) that the given message (MessageId) belongs to

Declaration
Task RenameMailingByMessageIdAsync(int messageId, string name, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int messageId

Message id

string name

The new name

CancellationToken cancellationToken
Returns
Type Description
Task

SaveFormEntityAsync(FormEntity, CancellationToken)

Updates the existing FormEntity or creates a new FormEntity if the id parameter is empty

Declaration
Task<FormEntity> SaveFormEntityAsync(FormEntity formEntity, CancellationToken cancellationToken = default)
Parameters
Type Name Description
FormEntity formEntity

The FormEntity that is saved.

CancellationToken cancellationToken
Returns
Type Description
Task<FormEntity>

New or updated FormEntity

SaveFormSubmissionEntityAsync(FormSubmissionEntity, CancellationToken)

Updates the existing FormSubmissionEntity or creates a new FormSubmissionEntity if the id parameter is empty

Declaration
Task<FormSubmissionEntity> SaveFormSubmissionEntityAsync(FormSubmissionEntity formSubmissionEntity, CancellationToken cancellationToken = default)
Parameters
Type Name Description
FormSubmissionEntity formSubmissionEntity

The FormSubmissionEntity that is saved.

CancellationToken cancellationToken
Returns
Type Description
Task<FormSubmissionEntity>

New or updated FormSubmissionEntity

SaveShipmentMessageBlockEntityAsync(ShipmentMessageBlockEntity, CancellationToken)

Updates the existing ShipmentMessageBlockEntity or creates a new ShipmentMessageBlockEntity if the id parameter is empty

Declaration
Task<ShipmentMessageBlockEntity> SaveShipmentMessageBlockEntityAsync(ShipmentMessageBlockEntity shipmentMessageBlockEntity, CancellationToken cancellationToken = default)
Parameters
Type Name Description
ShipmentMessageBlockEntity shipmentMessageBlockEntity

The ShipmentMessageBlockEntity that is saved.

CancellationToken cancellationToken
Returns
Type Description
Task<ShipmentMessageBlockEntity>

New or updated ShipmentMessageBlockEntity

SaveShipmentMessageEntityAsync(ShipmentMessageEntity, CancellationToken)

Updates the existing ShipmentMessageEntity or creates a new ShipmentMessageEntity if the id parameter is empty

Declaration
Task<ShipmentMessageEntity> SaveShipmentMessageEntityAsync(ShipmentMessageEntity shipmentMessageEntity, CancellationToken cancellationToken = default)
Parameters
Type Name Description
ShipmentMessageEntity shipmentMessageEntity

The ShipmentMessageEntity that is saved.

CancellationToken cancellationToken
Returns
Type Description
Task<ShipmentMessageEntity>

New or updated ShipmentMessageEntity

VerifyGoogleRecaptchaAsync(string, string, CancellationToken)

This method will try to verify a Google recaptcha token. The token is gained from the recaptcha frontend component

Declaration
Task<bool> VerifyGoogleRecaptchaAsync(string token, string optionalSecretKey, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string token

The token to be verified

string optionalSecretKey

Use an optional secret key instead of the system wide

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

Returns true if the recaptcha token verified successfully

© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top