mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-10-16 02:46:16 -05:00
Feature: add support for emailing multiple documents (#10666)
--------- Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
@@ -357,17 +357,15 @@ it('should include custom fields in sort fields if user has permission', () => {
|
||||
|
||||
it('should call appropriate api endpoint for email document', () => {
|
||||
subscription = service
|
||||
.emailDocument(
|
||||
documents[0].id,
|
||||
.emailDocuments(
|
||||
[documents[0].id],
|
||||
'hello@paperless-ngx.com',
|
||||
'hello',
|
||||
'world',
|
||||
true
|
||||
)
|
||||
.subscribe()
|
||||
httpTestingController.expectOne(
|
||||
`${environment.apiBaseUrl}${endpoint}/${documents[0].id}/email/`
|
||||
)
|
||||
httpTestingController.expectOne(`${environment.apiBaseUrl}${endpoint}/email/`)
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
|
@@ -256,14 +256,15 @@ export class DocumentService extends AbstractPaperlessService<Document> {
|
||||
return this._searchQuery
|
||||
}
|
||||
|
||||
emailDocument(
|
||||
documentId: number,
|
||||
emailDocuments(
|
||||
documentIds: number[],
|
||||
addresses: string,
|
||||
subject: string,
|
||||
message: string,
|
||||
useArchiveVersion: boolean
|
||||
): Observable<any> {
|
||||
return this.http.post(this.getResourceUrl(documentId, 'email'), {
|
||||
return this.http.post(this.getResourceUrl(null, 'email'), {
|
||||
documents: documentIds,
|
||||
addresses: addresses,
|
||||
subject: subject,
|
||||
message: message,
|
||||
|
Reference in New Issue
Block a user