Show / Hide Table of Contents

Class MarketingAgent

Proxy class for the Marketing Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.

Inheritance
object
MarketingAgent
Implements
IMarketingAgent
IAgent
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOfficeCRMServices
Assembly: SuperOffice.Services.Implementation.dll
Syntax
public class MarketingAgent : IMarketingAgent, IAgent

Constructors

MarketingAgent(IFormEntityImplementation, IFormSubmissionEntityImplementation, IMailingStatisticsImplementation, IPreviewMailingImplementation, IPreviewMailingHeaderImplementation, IShipmentMessageBlockEntityImplementation, IShipmentMessageEntityImplementation, ISoRequestItemsAccessor)

Declaration
public MarketingAgent(IFormEntityImplementation formEntityImplementation, IFormSubmissionEntityImplementation formSubmissionEntityImplementation, IMailingStatisticsImplementation mailingStatisticsImplementation, IPreviewMailingImplementation previewMailingImplementation, IPreviewMailingHeaderImplementation previewMailingHeaderImplementation, IShipmentMessageBlockEntityImplementation shipmentMessageBlockEntityImplementation, IShipmentMessageEntityImplementation shipmentMessageEntityImplementation, ISoRequestItemsAccessor accessor)
Parameters
Type Name Description
IFormEntityImplementation formEntityImplementation
IFormSubmissionEntityImplementation formSubmissionEntityImplementation
IMailingStatisticsImplementation mailingStatisticsImplementation
IPreviewMailingImplementation previewMailingImplementation
IPreviewMailingHeaderImplementation previewMailingHeaderImplementation
IShipmentMessageBlockEntityImplementation shipmentMessageBlockEntityImplementation
IShipmentMessageEntityImplementation shipmentMessageEntityImplementation
SuperOffice.Factory.ISoRequestItemsAccessor accessor

MarketingAgent(IFormEntityImplementation, IFormSubmissionEntityImplementation, IMailingStatisticsImplementation, IPreviewMailingImplementation, IPreviewMailingHeaderImplementation, IShipmentMessageBlockEntityImplementation, IShipmentMessageEntityImplementation, ISoRequestItemsAccessor, IDebugUser, IServiceCallsRepository, IScriptingConfiguration, IOnlineConfiguration)

Declaration
public MarketingAgent(IFormEntityImplementation formEntityImplementation, IFormSubmissionEntityImplementation formSubmissionEntityImplementation, IMailingStatisticsImplementation mailingStatisticsImplementation, IPreviewMailingImplementation previewMailingImplementation, IPreviewMailingHeaderImplementation previewMailingHeaderImplementation, IShipmentMessageBlockEntityImplementation shipmentMessageBlockEntityImplementation, IShipmentMessageEntityImplementation shipmentMessageEntityImplementation, ISoRequestItemsAccessor accessor, IDebugUser debugUser, IServiceCallsRepository serviceCallsRepository, ConfigFile.IScriptingConfiguration scriptingConfiguration, ConfigFile.IOnlineConfiguration onlineConfiguration)
Parameters
Type Name Description
IFormEntityImplementation formEntityImplementation
IFormSubmissionEntityImplementation formSubmissionEntityImplementation
IMailingStatisticsImplementation mailingStatisticsImplementation
IPreviewMailingImplementation previewMailingImplementation
IPreviewMailingHeaderImplementation previewMailingHeaderImplementation
IShipmentMessageBlockEntityImplementation shipmentMessageBlockEntityImplementation
IShipmentMessageEntityImplementation shipmentMessageEntityImplementation
SuperOffice.Factory.ISoRequestItemsAccessor accessor
SuperOffice.Data.IDebugUser debugUser
SuperOffice.Diagnostics.IServiceCallsRepository serviceCallsRepository
SuperOffice.Configuration.ConfigFile.IScriptingConfiguration scriptingConfiguration
SuperOffice.Configuration.ConfigFile.IOnlineConfiguration onlineConfiguration

Methods

CalculateMailingStatisticsAsync(int, CancellationToken)

Calculate open and click rates for one or more mailings

Declaration
public 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

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Taskint

Number of shipments updated with calculated statistics

CreateDefaultFormEntityAsync(CancellationToken)

Loading default values into a new FormEntity.

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

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskFormEntity

New FormEntity with default values

CreateDefaultFormSubmissionEntityAsync(CancellationToken)

Loading default values into a new FormSubmissionEntity.

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

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskFormSubmissionEntity

New FormSubmissionEntity with default values

CreateDefaultShipmentMessageBlockEntityAsync(CancellationToken)

Loading default values into a new ShipmentMessageBlockEntity.

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

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskShipmentMessageBlockEntity

New ShipmentMessageBlockEntity with default values

CreateDefaultShipmentMessageEntityAsync(CancellationToken)

Loading default values into a new ShipmentMessageEntity.

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

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskShipmentMessageEntity

New ShipmentMessageEntity with default values

DeleteFormEntityAsync(int, CancellationToken)

Deletes the FormEntity

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

The identity of the FormEntity

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task

This method has no return value

DeleteFormSubmissionEntityAsync(int, CancellationToken)

Deletes the FormSubmissionEntity

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

The identity of the FormSubmissionEntity

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task

This method has no return value

DeleteMessageAndShipmentAsync(int, CancellationToken)

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

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

Message id

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task

DeleteShipmentMessageBlockEntityAsync(int, CancellationToken)

Deletes the ShipmentMessageBlockEntity

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

The identity of the ShipmentMessageBlockEntity

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task

This method has no return value

DeleteShipmentMessageEntityAsync(int, CancellationToken)

Deletes the ShipmentMessageEntity

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

The identity of the ShipmentMessageEntity

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task

This method has no return value

GetFormEntityAsync(int, CancellationToken)

Gets a FormEntity object.

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

The identifier of the FormEntity object

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskFormEntity

A single FormEntity

GetFormSubmissionEntityAsync(int, CancellationToken)

Gets a FormSubmissionEntity object.

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

The identifier of the FormSubmissionEntity object

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskFormSubmissionEntity

A single 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
public 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

SuperOffice.Data.FormSubmissionStatus status

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

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Taskint

Number of formsubmissions

GetPreviewMailingAsync(int, CancellationToken)

Get a shipment message from its shipment address id

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

Shipment address id

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskPreviewMailing

PreviewMailing

GetPreviewMailingHeaderAsync(int, CancellationToken)

Get a shipment from its shipment id

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

Shipment id

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskPreviewMailingHeader

PreviewMailingHeader

GetShipmentMessageBlockEntityAsync(int, CancellationToken)

Gets a ShipmentMessageBlockEntity object.

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

The identifier of the ShipmentMessageBlockEntity object

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskShipmentMessageBlockEntity

A single ShipmentMessageBlockEntity

GetShipmentMessageEntityAsync(int, CancellationToken)

Gets a ShipmentMessageEntity object.

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

The identifier of the ShipmentMessageEntity object

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskShipmentMessageEntity

A single ShipmentMessageEntity

GetUserBlocksAsync(int, CancellationToken)

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

Declaration
public 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

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskShipmentMessageBlockEntity

An array of user blocks

RenameMailingByMessageIdAsync(int, string, CancellationToken)

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

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

Message id

string name

The new name

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Task

SaveFormEntityAsync(FormEntity, CancellationToken)

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

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

The FormEntity that is saved

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskFormEntity

New or updated FormEntity

SaveFormSubmissionEntityAsync(FormSubmissionEntity, CancellationToken)

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

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

The FormSubmissionEntity that is saved

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskFormSubmissionEntity

New or updated FormSubmissionEntity

SaveShipmentMessageBlockEntityAsync(ShipmentMessageBlockEntity, CancellationToken)

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

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

The ShipmentMessageBlockEntity that is saved

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskShipmentMessageBlockEntity

New or updated ShipmentMessageBlockEntity

SaveShipmentMessageEntityAsync(ShipmentMessageEntity, CancellationToken)

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

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

The ShipmentMessageEntity that is saved

CancellationToken cancellationToken

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
TaskShipmentMessageEntity

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
public 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

This operation cannot be cancelled; the cancellationToken parameter is ignored

Returns
Type Description
Taskbool

Returns true if the recaptcha token verified successfully

Implements

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