Example #1
0
        public virtual byte[] LoadQueuedEmailAttachmentBinary(QueuedEmailAttachment attachment)
        {
            Guard.NotNull(attachment, nameof(attachment));

            if (attachment.StorageLocation == EmailAttachmentStorageLocation.Blob)
            {
                return(_storageProvider.Value.Load(attachment.ToMedia()));
            }

            return(null);
        }
Example #2
0
        public virtual void DeleteQueuedEmailAttachment(QueuedEmailAttachment attachment)
        {
            Guard.NotNull(attachment, nameof(attachment));

            // delete from storage
            if (attachment.StorageLocation == EmailAttachmentStorageLocation.Blob)
            {
                _storageProvider.Value.Remove(attachment.ToMedia());
            }

            _queuedEmailAttachmentRepository.Delete(attachment);
        }