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.
Inherited Members
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.Implementation.dll
Syntax
public class MarketingAgent : IMarketingAgent, IAgent
Constructors
MarketingAgent(IAvailableFontImplementation, IFormEntityImplementation, IFormSubmissionEntityImplementation, IMailingStatisticsImplementation, IPreviewMailingImplementation, IPreviewMailingHeaderImplementation, IShipmentMessageBlockEntityImplementation, IShipmentMessageEntityImplementation, ISoRequestItemsAccessor)
Proxy class for the Marketing Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Declaration
public MarketingAgent(IAvailableFontImplementation availableFontImplementation, IFormEntityImplementation formEntityImplementation, IFormSubmissionEntityImplementation formSubmissionEntityImplementation, IMailingStatisticsImplementation mailingStatisticsImplementation, IPreviewMailingImplementation previewMailingImplementation, IPreviewMailingHeaderImplementation previewMailingHeaderImplementation, IShipmentMessageBlockEntityImplementation shipmentMessageBlockEntityImplementation, IShipmentMessageEntityImplementation shipmentMessageEntityImplementation, ISoRequestItemsAccessor accessor)
Parameters
| Type | Name | Description |
|---|---|---|
| IAvailableFontImplementation | availableFontImplementation | |
| IFormEntityImplementation | formEntityImplementation | |
| IFormSubmissionEntityImplementation | formSubmissionEntityImplementation | |
| IMailingStatisticsImplementation | mailingStatisticsImplementation | |
| IPreviewMailingImplementation | previewMailingImplementation | |
| IPreviewMailingHeaderImplementation | previewMailingHeaderImplementation | |
| IShipmentMessageBlockEntityImplementation | shipmentMessageBlockEntityImplementation | |
| IShipmentMessageEntityImplementation | shipmentMessageEntityImplementation | |
| ISoRequestItemsAccessor | accessor |
MarketingAgent(IAvailableFontImplementation, IFormEntityImplementation, IFormSubmissionEntityImplementation, IMailingStatisticsImplementation, IPreviewMailingImplementation, IPreviewMailingHeaderImplementation, IShipmentMessageBlockEntityImplementation, IShipmentMessageEntityImplementation, ISoRequestItemsAccessor, IDebugUser, IServiceCallsRepository, IScriptingConfiguration, IOnlineConfiguration)
Proxy class for the Marketing Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Declaration
public MarketingAgent(IAvailableFontImplementation availableFontImplementation, 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 |
|---|---|---|
| IAvailableFontImplementation | availableFontImplementation | |
| IFormEntityImplementation | formEntityImplementation | |
| IFormSubmissionEntityImplementation | formSubmissionEntityImplementation | |
| IMailingStatisticsImplementation | mailingStatisticsImplementation | |
| IPreviewMailingImplementation | previewMailingImplementation | |
| IPreviewMailingHeaderImplementation | previewMailingHeaderImplementation | |
| IShipmentMessageBlockEntityImplementation | shipmentMessageBlockEntityImplementation | |
| IShipmentMessageEntityImplementation | shipmentMessageEntityImplementation | |
| ISoRequestItemsAccessor | accessor | |
| IDebugUser | debugUser | |
| IServiceCallsRepository | serviceCallsRepository | |
| IScriptingConfiguration | scriptingConfiguration | |
| 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 |
|---|---|
| Task<int> | Number of shipments updated with calculated statistics |
CreateDefaultAvailableFontAsync(CancellationToken)
Create an return an empty font
Declaration
public Task<AvailableFont> CreateDefaultAvailableFontAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<AvailableFont> | Returns the created default font |
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 |
|---|---|
| Task<FormEntity> | 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 |
|---|---|
| Task<FormSubmissionEntity> | 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 |
|---|---|
| Task<ShipmentMessageBlockEntity> | 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 |
|---|---|
| Task<ShipmentMessageEntity> | New ShipmentMessageEntity with default values |
DeleteAvailableFontAsync(int, CancellationToken)
Delete the font with the provided id
Declaration
public Task<bool> DeleteAvailableFontAsync(int availableFontId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | availableFontId | The id of the font to delete |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<bool> | Returns true if the font was deleted |
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 |
GetAvailableFontAsync(int, CancellationToken)
Get an available font by id
Declaration
public Task<AvailableFont> GetAvailableFontAsync(int availableFontId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | availableFontId | The id of the font to retrieve |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<AvailableFont> | Returns the requested font or null if it does not exist |
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 |
|---|---|
| Task<FormEntity> | 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 |
|---|---|
| Task<FormSubmissionEntity> | 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 |
| 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 |
|---|---|
| Task<int> | 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 |
|---|---|
| Task<PreviewMailing> | 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 |
|---|---|
| Task<PreviewMailingHeader> | 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 |
|---|---|
| Task<ShipmentMessageBlockEntity> | 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 |
|---|---|
| Task<ShipmentMessageEntity> | 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 |
|---|---|
| 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
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 |
SaveAvailableFontAsync(AvailableFont, CancellationToken)
Saves the font and returns it with correct rank
Declaration
public Task<AvailableFont> SaveAvailableFontAsync(AvailableFont font, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| AvailableFont | font | The font to save |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<AvailableFont> | Returns the saved font with correct rank |
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 |
|---|---|
| Task<FormEntity> | 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 |
|---|---|
| Task<FormSubmissionEntity> | 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 |
|---|---|
| Task<ShipmentMessageBlockEntity> | 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 |
|---|---|
| Task<ShipmentMessageEntity> | New or updated ShipmentMessageEntity |
SetFontRankAsync(int, int, CancellationToken)
Set the rank on the font and reorder the rest of the fonts accordingly
Declaration
public Task<bool> SetFontRankAsync(int availableFontId, int rank, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | availableFontId | The id of the available font to set the rank on |
| int | rank | The new rank to set on the font |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<bool> | Returns true if the new rank on the font and surrounding reranks went well |
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 |
|---|---|
| Task<bool> | Returns true if the recaptcha token verified successfully |