Невозможно прикрепить файл в приложении Ionic3 UWP с помощью компоновщика электронной почты - PullRequest
0 голосов
/ 03 июля 2019

Привет, команда. Я пытаюсь создать файл .csv, используя плагин «Файл», и прикрепить его в электронном письме с плагином «EmailComposer» с приложением ionic - UWP.Я могу создать файл по базовому пути, но при подключении по тому же пути он не работает.Я вижу, что электронное письмо открывается с телом, темой и т. Д., Но без вложений. Я не уверен ... я указываю неправильный путь для вложений.любая помощь здесь?

createAccessLogFileAndWrite(text: string) {
    this.file.checkFile(this.file.dataDirectory, 'notes.csv')
      .then(doesExist => {
        console.log("doesExist : " + doesExist);
        return this.writeToAccessLogFile(text);
      }).catch(err => {
        return this.file.createFile(this.file.dataDirectory, 'notes.csv', false)
          .then(FileEntry => this.writeToAccessLogFile(text))
          .catch(err => console.log('Couldnt create file'));
      });
  }

  writeToAccessLogFile(text: string) {
    console.log('file location ' + this.file.dataDirectory)
    this.file.writeExistingFile(this.file.dataDirectory, 'notes.csv', text)
      .then(() => {
        let email = {
          to: 'email@email',
          attachments: [
            this.file.dataDirectory + 'notes.csv'
          ],

          subject: 'subject',
          body: 'body text...',
          isHtml: true
        };
        this.emailComposer.open(email);

      })
      .catch((err) => {
        console.error(JSON.stringify(err));
      });
  }
...