I want to send my signature in an email but I don't manage to do it
Here's my code :
import { Component, ViewChild } from '@angular/core';
import { NavController} from 'ionic-angular';
import { SignaturePad } from 'angular2-signaturepad/signature-pad';
import { EmailComposer } from '@ionic-native/email-composer';
@Component({
selector: 'page-envoie',
templateUrl: 'envoie.html',
providers: [SignaturePad, EmailComposer]
})
export class EnvoiePage {
@ViewChild(SignaturePad) public signaturePad: SignaturePad;
public signatureImage : string;
public signaturePadOptions: Object = {
'minWidth': 2,
'canvasWidth': 340,
'canvasHeight': 200 };
public Cancel: string;
constructor(public navCtrl: NavController, private emailComposer: EmailComposer){
this.signatureImage = this.signaturePad.toDataURL();
this.Cancel = this.signatureImage;
}
drawComplete() {
this.signatureImage = this.signaturePad.toDataURL();
this.emailComposer.open({
to: 'lol@me.com',
attachments: [this.signatureImage],
subject: 'Avis de passage',
body: 'test',
isHtml: true
});
}
drawClear() {
this.signaturePad.clear();
}
}
Can you help me? I'm lost, when I press the button, the email is opened there is my text but not the image
It's the plugin signature pad and the emailcomposer