feat(application): register AutoMapper mappings for new commands and add SendAndAppend to IImapEmailService
This commit is contained in:
@@ -37,5 +37,14 @@ public interface IImapEmailService
|
|||||||
/// <param name="folder"></param>
|
/// <param name="folder"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
DateTime? GetLastImapSyncDate(int accountId, string folder = "INBOX");
|
DateTime? GetLastImapSyncDate(int accountId, string folder = "INBOX");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sends an email via SMTP using the account credentials and appends the sent message
|
||||||
|
/// to the account's IMAP Sent Items folder.
|
||||||
|
/// </summary>
|
||||||
|
Task SendAndAppendAsync(
|
||||||
|
EmailContext context,
|
||||||
|
string sentFolder = "Sent",
|
||||||
|
CancellationToken cancellationToken = default);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -20,6 +20,16 @@ public class EmailMappingProfile : Profile
|
|||||||
.ForMember(dest => dest.Sender, opt => opt.Ignore())
|
.ForMember(dest => dest.Sender, opt => opt.Ignore())
|
||||||
.ForMember(dest => dest.Attachments, opt => opt.MapFrom(src => src.Attachments));
|
.ForMember(dest => dest.Attachments, opt => opt.MapFrom(src => src.Attachments));
|
||||||
|
|
||||||
|
// PublishEmailViaImapCommand -> EmailContext
|
||||||
|
CreateMap<PublishEmailViaImapCommand, EmailContext>()
|
||||||
|
.ForMember(dest => dest.Sender, opt => opt.Ignore())
|
||||||
|
.ForMember(dest => dest.Attachments, opt => opt.MapFrom(src => src.Attachments));
|
||||||
|
|
||||||
|
// PublishEmailViaOAuth2Command -> EmailContext
|
||||||
|
CreateMap<PublishEmailViaOAuth2Command, EmailContext>()
|
||||||
|
.ForMember(dest => dest.Sender, opt => opt.Ignore())
|
||||||
|
.ForMember(dest => dest.Attachments, opt => opt.MapFrom(src => src.Attachments));
|
||||||
|
|
||||||
// EmailAccountDto -> EmailAccount
|
// EmailAccountDto -> EmailAccount
|
||||||
CreateMap<EmailAccount, EmailAccountDto>();
|
CreateMap<EmailAccount, EmailAccountDto>();
|
||||||
CreateMap<EmailAccountModificationDto, EmailAccount>();
|
CreateMap<EmailAccountModificationDto, EmailAccount>();
|
||||||
|
|||||||
Reference in New Issue
Block a user