Class EmailInfoProvider
- Namespace
- CMS.EmailEngine
- Assembly
- CMS.EmailEngine.dll
Class providing EmailInfo management.
[ProviderInterface(typeof(IEmailInfoProvider))]
[Obsolete("Use CMS.DataEngine.IInfoProvider<EmailInfo> instead. Use CMS.DataEngine.InfoProviderExtensions for additional methods for individual objects retrieval. To get an instance of the interface's implementation use dependency injection or access the instance directly via the CMS.DataEngine.Provider<EmailInfo>.Instance property. When faking metadata in CMS.Tests.UnitTests using Fake() use the obsolete provider class until fully removed.")]
public class EmailInfoProvider : AbstractInfoProvider<EmailInfo, EmailInfoProvider>, IInfoProvider, ICustomizableProvider, IBulkOperationProvider, IWebFarmProvider, IInfoValidator<EmailInfo>, IInfoByGuidProvider<EmailInfo>, IInfoByNameProvider<EmailInfo>, IBulkInfoProvider<EmailInfo>, IEmailInfoProvider, IInfoProvider<EmailInfo>, IInfoByIdProvider<EmailInfo>
- Inheritance
-
objectEmailInfoProvider
- Implements
- Inherited Members
-
AbstractInfoProvider<EmailInfo, EmailInfoProvider, ObjectQuery<EmailInfo>>.CreateInfo(DataRow, bool)
- Extension Methods
Constructors
EmailInfoProvider()
public EmailInfoProvider()
Methods
BindEmailAttachment(int, string, string, string, int, byte[], string, Guid, DateTime)
Add attachment to specified e-mail and return its ID.
[Obsolete("Use CMS.EmailEngine.EmailInfoUtils.BindAttachment(int, string, string, string, int, byte[], string, Guid, DateTime) instead.")]
public static int BindEmailAttachment(int emailId, string name, string extension, string mimetype, int size, byte[] binary, string contentId, Guid guid, DateTime lastModified)
Parameters
emailIdintE-mail
namestringAttachment name
extensionstringAttachment extension
mimetypestringAttachment type
sizeintSize of the attachment
binarybyte[]Binary data
contentIdstringAttachment content ID
guidGuidAttachment GUID
lastModifiedDateTimeLast modification date of the attachment
Returns
- int
DeleteAll(EmailStatusEnum, bool)
Deletes all EmailInfo objects with specific parameters.
[Obsolete("The method is no longer used by the system and will be removed.")]
public static void DeleteAll(EmailStatusEnum status, bool onlyFailed)
Parameters
statusEmailStatusEnumE-mail status
onlyFailedboolIf true failed e-mails are deleted, failed e-mail status is waiting
DeleteArchived(DateTime, int)
Deletes expired archived e-mails. Size of deleted "batch" is specified by batchSize.
[Obsolete("Use CMS.EmailEngine.EmailInfoUtils.DeleteArchived(DateTime, int) instead.")]
public static int DeleteArchived(DateTime expirationDate, int batchSize)
Parameters
expirationDateDateTimeEvery archived email older that expiration date will be deleted
batchSizeintNumber of emails to be deleted at once
Returns
- int
Returns number of deleted emails.
FetchEmails(EmailMailoutEnum, int, int, DateTime?)
Fetches e-mails which should be sent and marks them as being sent.
[Obsolete("Method was not intended for public use and will be removed in the next version.")]
public static DataSet FetchEmails(EmailMailoutEnum emailsToFetch, int firstEmailId, int batchSize, DateTime? failedEmailsNewerThan = null)
Parameters
emailsToFetchEmailMailoutEnumDetermines which e-mails are to be fetched
firstEmailIdintFirst email ID (only e-mails with the same or higher ID are fetched)
batchSizeintNumber of e-mails to retrieve; default value is 0 - in this case batch size is retrieved from Settings
failedEmailsNewerThanDateTime?Timestamp indicating that only failed emails that are younger than given date should be sent. Only works for Failed.
Returns
- DataSet
DataSet with fetched e-mails
GetEmailExpirationTime()
Gets email expiration time for archived emails.
[Obsolete("Use the CMS.EmailEngine.EmailQueueOptions.ArchiveDuration property directly (using the options pattern).")]
public static DateTime GetEmailExpirationTime()
Returns
- DateTime
GetExpiredEmailCount(DateTime)
Gets the number of archived emails that are older that expiration date.
[Obsolete("Use CMS.EmailEngine.EmailInfoProviderExtensions.GetExpiredCount(IInfoProvider<EmailInfo>, DateTime) instead.")]
public static int GetExpiredEmailCount(DateTime expirationDate)
Parameters
expirationDateDateTimeExpiration date.
Returns
- int
ResendEmails(IEnumerable<int>, CancellationToken)
Re-sends e-mails specified by their IDs. If some of the specified emails are already being sent, they are NOT send again.
[Obsolete("Use CMS.EmailEngine.EmailInfoUtils.Resend(IEnumerable<int>, CancellationToken) instead.")]
public static Task ResendEmails(IEnumerable<int> ids, CancellationToken cancellationToken)
Parameters
idsIEnumerable<int>IDs of the emails that are to be sent
cancellationTokenCancellationTokenCancellation token.
Returns
- Task
SetEmailInfo(EmailMessage, bool)
Creates new EmailInfo from EmailMessage.
[Obsolete("Use CMS.EmailEngine.EmailInfoProviderExtensions.SetMessage(IInfoProvider<EmailInfo>, EmailMessage, bool) instead.")]
public static EmailInfo SetEmailInfo(EmailMessage message, bool dontSend = false)
Parameters
messageEmailMessageEmail message
dontSendboolIf true, e-mail status remains 'being created' so it could not be sent
Returns
- EmailInfo
EmailInfo object