* Added EmailAddresses and WzNumbers to WzHeader
* Changed approach to send email to addresses added to WzHeader
This commit is contained in:
@@ -37,4 +37,18 @@ public class WzHeaderService(SytelineSaAppDbContext context, IMapper mapper) : I
|
||||
|
||||
return wzHeader;
|
||||
}
|
||||
|
||||
public async Task AddEmailsToWzHeader(Guid id, string emailAddresses)
|
||||
{
|
||||
var entity = await context.WzHeaders.FindAsync(id);
|
||||
|
||||
if (entity == null)
|
||||
{
|
||||
throw new KeyNotFoundException($"WzHeader with ID {id} not found.");
|
||||
}
|
||||
|
||||
entity.EmailAddresses = emailAddresses;
|
||||
context.WzHeaders.Update(entity);
|
||||
await context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user